Style: format code by gofumpt (#761)

This commit is contained in:
yuhan6665 2021-10-19 12:57:14 -04:00 committed by GitHub
parent d77be80b40
commit e286cdcaa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 293 additions and 291 deletions

View file

@ -9,8 +9,7 @@ type BalancingStrategy interface {
PickOutbound([]string) string
}
type RandomStrategy struct {
}
type RandomStrategy struct{}
func (s *RandomStrategy) PickOutbound(tags []string) string {
n := len(tags)

View file

@ -186,6 +186,4 @@ func (c *GeoIPMatcherContainer) Add(geoip *GeoIP) (*GeoIPMatcher, error) {
return m, nil
}
var (
globalGeoIPContainer GeoIPMatcherContainer
)
var globalGeoIPContainer GeoIPMatcherContainer

View file

@ -89,7 +89,8 @@ func TestGeoIPMatcher(t *testing.T) {
{
Input: "192.0.1.0",
Output: false,
}, {
},
{
Input: "0.1.0.0",
Output: true,
},

View file

@ -84,7 +84,6 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
newError("MphDomainMatcher is enabled for ", len(rr.Domain), " domain rule(s)").AtDebug().WriteToLog()
conds.Add(matcher)
}
}
if len(rr.UserEmail) > 0 {

View file

@ -80,7 +80,6 @@ func (r *Router) PickRoute(ctx routing.Context) (routing.Route, error) {
}
func (r *Router) pickRouteInternal(ctx routing.Context) (*Rule, routing.Context, error) {
// SkipDNSResolve is set from DNS module.
// the DOH remote server maybe a domain name,
// this prevents cycle resolving dead loop

View file

@ -2,9 +2,10 @@ package router_test
import (
"context"
"github.com/xtls/xray-core/features/dns"
"testing"
"github.com/xtls/xray-core/features/dns"
"github.com/golang/mock/gomock"
. "github.com/xtls/xray-core/app/router"