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

See also #34394 #34252

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2024-08-01 10:01:49 +08:00 committed by GitHub
parent c15d074b21
commit dfda9f0478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -123,6 +123,8 @@ linters-settings:
desc: not allowed, use github.com/tikv/client-go/v2/txnkv desc: not allowed, use github.com/tikv/client-go/v2/txnkv
- pkg: "github.com/gogo/protobuf" - pkg: "github.com/gogo/protobuf"
desc: "not allowed, gogo protobuf is deprecated" 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: forbidigo:
forbid: forbid:
- '^time\.Tick$' - '^time\.Tick$'

View File

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
"github.com/milvus-io/milvus/pkg/mocks/streaming/util/mock_message" "github.com/milvus-io/milvus/pkg/mocks/streaming/util/mock_message"

View File

@ -20,9 +20,9 @@ import (
"context" "context"
"time" "time"
"github.com/golang/protobuf/proto"
"github.com/samber/lo" "github.com/samber/lo"
"go.uber.org/zap" "go.uber.org/zap"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"