mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Style: format code by gofumpt (#761)
This commit is contained in:
@ -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)
|
||||
|
@ -186,6 +186,4 @@ func (c *GeoIPMatcherContainer) Add(geoip *GeoIP) (*GeoIPMatcher, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
var (
|
||||
globalGeoIPContainer GeoIPMatcherContainer
|
||||
)
|
||||
var globalGeoIPContainer GeoIPMatcherContainer
|
||||
|
@ -89,7 +89,8 @@ func TestGeoIPMatcher(t *testing.T) {
|
||||
{
|
||||
Input: "192.0.1.0",
|
||||
Output: false,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
Input: "0.1.0.0",
|
||||
Output: true,
|
||||
},
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
Reference in New Issue
Block a user