feat: golangci add goimports local-prefixes (#2413)

* feat: golangci goimports local-prefixes

* fix lint

* fix lint
pull/2431/head
jesse.tang 2 years ago committed by GitHub
parent 9f65c1a03d
commit 69fcd50c0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .golangci.yml
  2. 2
      contrib/registry/servicecomb/registry.go
  3. 3
      contrib/registry/servicecomb/registry_test.go
  4. 2
      contrib/registry/servicecomb/watcher.go
  5. 3
      transport/http/binding/encode.go

@ -67,3 +67,5 @@ linters-settings:
gocyclo:
# recommend 10-20
min-complexity: 50
goimports:
local-prefixes: github.com/go-kratos/kratos # Put imports beginning with prefix after 3rd-party packages

@ -9,10 +9,10 @@ import (
"github.com/go-chassis/cari/discovery"
"github.com/go-chassis/cari/pkg/errsvc"
"github.com/go-chassis/sc-client"
"github.com/gofrs/uuid"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
"github.com/gofrs/uuid"
)
func init() {

@ -6,8 +6,9 @@ import (
pb "github.com/go-chassis/cari/discovery"
"github.com/go-chassis/sc-client"
"github.com/go-kratos/kratos/v2/registry"
"github.com/gofrs/uuid"
"github.com/go-kratos/kratos/v2/registry"
)
var r *Registry

@ -2,9 +2,9 @@ package servicecomb
import (
"github.com/go-chassis/sc-client"
"golang.org/x/net/context"
"github.com/go-kratos/kratos/v2/registry"
"golang.org/x/net/context"
)
var _ registry.Watcher = (*Watcher)(nil)

@ -4,8 +4,9 @@ import (
"reflect"
"regexp"
"github.com/go-kratos/kratos/v2/encoding/form"
"google.golang.org/protobuf/proto"
"github.com/go-kratos/kratos/v2/encoding/form"
)
var reg = regexp.MustCompile(`{[\\.\w]+}`)

Loading…
Cancel
Save