enhance: Add depguard rules to ban deprecated proto lib (#35140) (#35818)

See also #34394 #34252
pr: #35140

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
Co-authored-by: congqixia <congqi.xia@zilliz.com>
This commit is contained in:
wei liu 2024-08-30 14:13:01 +08:00 committed by GitHub
parent 8cd75d627c
commit da026b1e28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View File

@ -120,6 +120,8 @@ linters-settings:
desc: not allowed, use github.com/tikv/client-go/v2/txnkv
- pkg: "github.com/gogo/protobuf"
desc: "not allowed, gogo protobuf is deprecated"
- pkg: "github.com/golang/protobuf/proto"
desc: "not allowed, protobuf v1 is deprecated, use google.golang.org/protobuf/proto instead"
forbidigo:
forbid:
- '^time\.Tick$'

2
go.mod
View File

@ -21,7 +21,7 @@ require (
github.com/go-playground/validator/v10 v10.14.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.2
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/klauspost/compress v1.17.7

View File

@ -25,10 +25,10 @@ import (
"time"
"github.com/cockroachdb/errors"
"github.com/golang/protobuf/proto"
"go.uber.org/zap"
"golang.org/x/crypto/bcrypt"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"

View File

@ -21,8 +21,8 @@ import (
"fmt"
"time"
"github.com/golang/protobuf/proto"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"