Browse Source

apply coding style

Shelikhoo 4 years ago
parent
commit
19d1ff9003

+ 3 - 2
infra/conf/geodata/memconservative/cache.go

@@ -1,11 +1,12 @@
 package memconservative
 package memconservative
 
 
 import (
 import (
+	"io/ioutil"
+	"strings"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
-	"io/ioutil"
-	"strings"
 )
 )
 
 
 type GeoIPCache map[string]*router.GeoIP
 type GeoIPCache map[string]*router.GeoIP

+ 3 - 3
infra/conf/geodata/memconservative/decode.go

@@ -2,10 +2,11 @@ package memconservative
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
-	"google.golang.org/protobuf/encoding/protowire"
 	"io"
 	"io"
 	"strings"
 	"strings"
+
+	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
+	"google.golang.org/protobuf/encoding/protowire"
 )
 )
 
 
 var (
 var (
@@ -84,7 +85,6 @@ Loop:
 			result = container
 			result = container
 			break Loop
 			break Loop
 		}
 		}
-
 	}
 	}
 	return result, nil
 	return result, nil
 }
 }

+ 5 - 4
infra/conf/geodata/memconservative/decode_test.go

@@ -2,14 +2,15 @@ package memconservative
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"github.com/google/go-cmp/cmp"
-	"github.com/v2fly/v2ray-core/v4/common"
-	"github.com/v2fly/v2ray-core/v4/common/platform"
-	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"io/fs"
 	"io/fs"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
 	"testing"
 	"testing"
+
+	"github.com/google/go-cmp/cmp"
+	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/common/platform"
+	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 )
 )
 
 
 const (
 const (

+ 3 - 4
infra/conf/geodata/memconservative/memc.go

@@ -1,9 +1,10 @@
 package memconservative
 package memconservative
 
 
 import (
 import (
+	"runtime"
+
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
-	"runtime"
 )
 )
 
 
 //go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
 //go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
@@ -36,7 +37,5 @@ func newMemConservativeLoader() geodata.LoaderImplementation {
 }
 }
 
 
 func init() {
 func init() {
-	geodata.RegisterGeoDataLoaderImplementationCreator("memconservative", func() geodata.LoaderImplementation {
-		return newMemConservativeLoader()
-	})
+	geodata.RegisterGeoDataLoaderImplementationCreator("memconservative", newMemConservativeLoader)
 }
 }