Skip to content

Commit 0ed159e

Browse files
committed
chore: code cleanup
1 parent 070eb31 commit 0ed159e

File tree

4 files changed

+12
-31
lines changed

4 files changed

+12
-31
lines changed

adapter/provider/provider.go

-7
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,6 @@ func (cp *CompatibleProvider) Close() error {
326326
return cp.compatibleProvider.Close()
327327
}
328328

329-
func proxiesOnUpdate(pd *proxySetProvider) func([]C.Proxy) {
330-
return func(elm []C.Proxy) {
331-
pd.setProxies(elm)
332-
pd.version += 1
333-
}
334-
}
335-
336329
func NewProxiesParser(filter string, excludeFilter string, excludeType string, dialerProxy string, override OverrideSchema) (resource.Parser[[]C.Proxy], error) {
337330
excludeFilterReg, err := regexp2.Compile(excludeFilter, regexp2.None)
338331
if err != nil {

config/config.go

-12
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,6 @@ type RawConfig struct {
428428
ClashForAndroid RawClashForAndroid `yaml:"clash-for-android" json:"clash-for-android"`
429429
}
430430

431-
var (
432-
GroupsList = list.New()
433-
ProxiesList = list.New()
434-
ParsingProxiesCallback func(groupsList *list.List, proxiesList *list.List)
435-
)
436-
437431
// Parse config
438432
func Parse(buf []byte) (*Config, error) {
439433
rawCfg, err := UnmarshalRawConfig(buf)
@@ -927,12 +921,6 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
927921
)
928922
proxies["GLOBAL"] = adapter.NewProxy(global)
929923
}
930-
ProxiesList = proxiesList
931-
GroupsList = groupsList
932-
if ParsingProxiesCallback != nil {
933-
// refresh tray menu
934-
go ParsingProxiesCallback(GroupsList, ProxiesList)
935-
}
936924
return proxies, providersMap, nil
937925
}
938926

go.mod

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ require (
77
github.com/bahlo/generic-list-go v0.2.0
88
github.com/coreos/go-iptables v0.8.0
99
github.com/dlclark/regexp2 v1.11.5
10-
github.com/enfein/mieru/v3 v3.11.2
10+
github.com/enfein/mieru/v3 v3.12.0
1111
github.com/go-chi/chi/v5 v5.2.1
1212
github.com/go-chi/render v1.0.3
1313
github.com/gobwas/ws v1.4.0
1414
github.com/gofrs/uuid/v5 v5.3.1
1515
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905
1616
github.com/klauspost/compress v1.17.9 // lastest version compatible with golang1.20
17-
github.com/klauspost/cpuid/v2 v2.2.9
17+
github.com/klauspost/cpuid/v2 v2.2.9 // lastest version compatible with golang1.20
1818
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40
1919
github.com/mdlayher/netlink v1.7.2
2020
github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab
@@ -37,7 +37,7 @@ require (
3737
github.com/mroth/weightedrand/v2 v2.1.0
3838
github.com/openacid/low v0.1.21
3939
github.com/oschwald/maxminddb-golang v1.12.0 // lastest version compatible with golang1.20
40-
github.com/puzpuzpuz/xsync/v3 v3.5.0
40+
github.com/puzpuzpuz/xsync/v3 v3.5.1
4141
github.com/sagernet/cors v1.2.1
4242
github.com/sagernet/fswatch v0.1.1
4343
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a
@@ -46,21 +46,21 @@ require (
4646
github.com/sagernet/sing-shadowtls v0.1.5
4747
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7
4848
github.com/samber/lo v1.49.1
49-
github.com/shirou/gopsutil/v4 v4.25.1
49+
github.com/shirou/gopsutil/v4 v4.25.1 // lastest version compatible with golang1.20
5050
github.com/sirupsen/logrus v1.9.3
5151
github.com/stretchr/testify v1.10.0
5252
github.com/vmihailenco/msgpack/v5 v5.4.1
5353
github.com/wk8/go-ordered-map/v2 v2.1.8
5454
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7
5555
go.uber.org/automaxprocs v1.6.0
5656
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
57-
golang.org/x/crypto v0.33.0
57+
golang.org/x/crypto v0.33.0 // lastest version compatible with golang1.20
5858
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // lastest version compatible with golang1.20
59-
golang.org/x/net v0.35.0
60-
golang.org/x/sys v0.30.0
59+
golang.org/x/net v0.35.0 // lastest version compatible with golang1.20
60+
golang.org/x/sys v0.30.0 // lastest version compatible with golang1.20
6161
google.golang.org/protobuf v1.34.2 // lastest version compatible with golang1.20
6262
gopkg.in/yaml.v3 v3.0.1
63-
lukechampine.com/blake3 v1.3.0
63+
lukechampine.com/blake3 v1.3.0 // lastest version compatible with golang1.20
6464
)
6565

6666
require (

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ
2828
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
2929
github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I=
3030
github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
31-
github.com/enfein/mieru/v3 v3.11.2 h1:06KyGbXiiGz2nSHLJDOOkztAVY3cRr3wBMOpYxPotTo=
32-
github.com/enfein/mieru/v3 v3.11.2/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw=
31+
github.com/enfein/mieru/v3 v3.12.0 h1:sV3moozWpRjjqwqFZJjGtMB0EacN8+D7BpjzsmacsXM=
32+
github.com/enfein/mieru/v3 v3.12.0/go.mod h1:zJBUCsi5rxyvHM8fjFf+GLaEl4OEjjBXr1s5F6Qd3hM=
3333
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 h1:/5RkVc9Rc81XmMyVqawCiDyrBHZbLAZgTTCqou4mwj8=
3434
github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I=
3535
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 h1:8j2RH289RJplhA6WfdaPqzg1MjH2K8wX5e0uhAxrw2g=
@@ -156,8 +156,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
156156
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
157157
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
158158
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
159-
github.com/puzpuzpuz/xsync/v3 v3.5.0 h1:i+cMcpEDY1BkNm7lPDkCtE4oElsYLn+EKF8kAu2vXT4=
160-
github.com/puzpuzpuz/xsync/v3 v3.5.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA=
159+
github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg=
160+
github.com/puzpuzpuz/xsync/v3 v3.5.1/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA=
161161
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
162162
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
163163
github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs=

0 commit comments

Comments
 (0)