mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-27 01:07:10 +00:00
chore: Cleanup code
This commit is contained in:
@@ -2,6 +2,4 @@
|
||||
|
||||
package features
|
||||
|
||||
func init() {
|
||||
TAGS = append(TAGS, "cmfa")
|
||||
}
|
||||
const CMFA = true
|
||||
|
||||
5
constant/features/cmfa_stub.go
Normal file
5
constant/features/cmfa_stub.go
Normal file
@@ -0,0 +1,5 @@
|
||||
//go:build !cmfa
|
||||
|
||||
package features
|
||||
|
||||
const CMFA = false
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
package features
|
||||
|
||||
func init() {
|
||||
TAGS = append(TAGS, "with_low_memory")
|
||||
}
|
||||
const WithLowMemory = true
|
||||
|
||||
5
constant/features/low_memory_stub.go
Normal file
5
constant/features/low_memory_stub.go
Normal file
@@ -0,0 +1,5 @@
|
||||
//go:build !with_low_memory
|
||||
|
||||
package features
|
||||
|
||||
const WithLowMemory = false
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
package features
|
||||
|
||||
func init() {
|
||||
TAGS = append(TAGS, "no_fake_tcp")
|
||||
}
|
||||
const NoFakeTCP = true
|
||||
|
||||
5
constant/features/no_fake_tcp_stub.go
Normal file
5
constant/features/no_fake_tcp_stub.go
Normal file
@@ -0,0 +1,5 @@
|
||||
//go:build !no_fake_tcp
|
||||
|
||||
package features
|
||||
|
||||
const NoFakeTCP = false
|
||||
@@ -1,11 +1,17 @@
|
||||
package features
|
||||
|
||||
import(
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
var TAGS = make([]string, 0, 0)
|
||||
|
||||
func Contains(feat string) (bool) {
|
||||
return slices.Contains(TAGS, feat)
|
||||
}
|
||||
func Tags() (tags []string) {
|
||||
if CMFA {
|
||||
tags = append(tags, "cmfa")
|
||||
}
|
||||
if WithLowMemory {
|
||||
tags = append(tags, "with_low_memory")
|
||||
}
|
||||
if NoFakeTCP {
|
||||
tags = append(tags, "no_fake_tcp")
|
||||
}
|
||||
if WithGVisor {
|
||||
tags = append(tags, "with_gvisor")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
package features
|
||||
|
||||
func init() {
|
||||
TAGS = append(TAGS, "with_gvisor")
|
||||
}
|
||||
const WithGVisor = true
|
||||
|
||||
5
constant/features/with_gvisor_stub.go
Normal file
5
constant/features/with_gvisor_stub.go
Normal file
@@ -0,0 +1,5 @@
|
||||
//go:build !with_gvisor
|
||||
|
||||
package features
|
||||
|
||||
const WithGVisor = false
|
||||
Reference in New Issue
Block a user