1.fix module package
2.fix govet error
This commit is contained in:
parent
8766764d49
commit
1350330fe0
5 changed files with 12 additions and 6 deletions
|
@ -604,7 +604,7 @@ func parseRules(cfg *RawConfig, proxies map[string]C.Proxy) ([]C.Rule, map[strin
|
||||||
|
|
||||||
if ruleName == "GEOSITE" {
|
if ruleName == "GEOSITE" {
|
||||||
if err := initGeoSite(); err != nil {
|
if err := initGeoSite(); err != nil {
|
||||||
return nil, nil, fmt.Errorf("can't initial GeoSite: %w", err)
|
return nil, nil, fmt.Errorf("can't initial GeoSite: %s", err)
|
||||||
}
|
}
|
||||||
initMode = false
|
initMode = false
|
||||||
}
|
}
|
||||||
|
@ -751,7 +751,7 @@ func parseFallbackGeoSite(countries []string, rules []C.Rule) ([]*router.DomainM
|
||||||
var sites []*router.DomainMatcher
|
var sites []*router.DomainMatcher
|
||||||
if len(countries) > 0 {
|
if len(countries) > 0 {
|
||||||
if err := initGeoSite(); err != nil {
|
if err := initGeoSite(); err != nil {
|
||||||
return nil, fmt.Errorf("can't initial GeoSite: %w", err)
|
return nil, fmt.Errorf("can't initial GeoSite: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -57,4 +57,4 @@ require (
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
replace golang.zx2c4.com/wintun v0.0.0-20211104114900-415007cec224 => github.com/MetaCubeX/wintun-go v0.0.0-20220317161916-5dcd44f3c355
|
replace golang.zx2c4.com/wintun v0.0.0-20211104114900-415007cec224 => github.com/MetaCubeX/wintun-go v0.0.0-20220317182248-e32f9221663c
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -10,8 +10,8 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/Dreamacro/go-shadowsocks2 v0.1.7 h1:8CtbE1HoPPMfrQZGXmlluq6dO2lL31W6WRRE8fabc4Q=
|
github.com/Dreamacro/go-shadowsocks2 v0.1.7 h1:8CtbE1HoPPMfrQZGXmlluq6dO2lL31W6WRRE8fabc4Q=
|
||||||
github.com/Dreamacro/go-shadowsocks2 v0.1.7/go.mod h1:8p5G4cAj5ZlXwUR+Ww63gfSikr8kvw8uw3TDwLAJpUc=
|
github.com/Dreamacro/go-shadowsocks2 v0.1.7/go.mod h1:8p5G4cAj5ZlXwUR+Ww63gfSikr8kvw8uw3TDwLAJpUc=
|
||||||
github.com/MetaCubeX/wintun-go v0.0.0-20220317161916-5dcd44f3c355 h1:mbXCKCy+r8fUoDQh40CFy/lTKmcXpOnzzaFScy8EhRo=
|
github.com/MetaCubeX/wintun-go v0.0.0-20220317182248-e32f9221663c h1:fyg+AJU5BRmuEGeVexyABUiChIBeZ1UaER4DaV0jSLo=
|
||||||
github.com/MetaCubeX/wintun-go v0.0.0-20220317161916-5dcd44f3c355/go.mod h1:ARUuShAtcziEJ/vnZ2hgoP+zc0J7Ukcca2S/NPDoQCc=
|
github.com/MetaCubeX/wintun-go v0.0.0-20220317182248-e32f9221663c/go.mod h1:9ekUVS60VUdCP+s3E8TkAHmk04Wsu3DGU4Ruq8N7kaQ=
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
||||||
|
|
|
@ -97,3 +97,9 @@ func newLog(logLevel LogLevel, format string, v ...any) *Event {
|
||||||
Payload: fmt.Sprintf(format, v...),
|
Payload: fmt.Sprintf(format, v...),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PrintLog(logLevel LogLevel, format string, v ...interface{}) {
|
||||||
|
event := newLog(logLevel, format, v...)
|
||||||
|
logCh <- event
|
||||||
|
print(event)
|
||||||
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ func payloadToRule(subPayload string) (C.Rule, error) {
|
||||||
}
|
}
|
||||||
if tp == "GEOSITE" {
|
if tp == "GEOSITE" {
|
||||||
if err := initGeoSite(); err != nil {
|
if err := initGeoSite(); err != nil {
|
||||||
log.Errorln("can't initial GeoSite: %w", err)
|
log.Errorln("can't initial GeoSite: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue