Skip to content

Commit 35a4b9a

Browse files
committed
Fix lint: add checked type assertion and allow protobuf/proto in depguard
1 parent f3d8a55 commit 35a4b9a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ linters-settings:
3939
- "github.com/getsentry/sentry-go"
4040
- "github.com/spf13/cast"
4141
- "github.com/go-co-op/gocron"
42-
- "google.golang.org/protobuf/types/known/emptypb"
42+
- "google.golang.org/protobuf"
4343
- "google.golang.org/grpc"

plugin/plugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ func (p *Plugin) OnTrafficFromServer(
297297
_ context.Context, resp *v1.Struct,
298298
) (*v1.Struct, error) {
299299
p.Logger.Debug("Traffic is coming from the server side")
300-
p.UpdateCacheChannel <- proto.Clone(resp).(*v1.Struct)
300+
if cloned, ok := proto.Clone(resp).(*v1.Struct); ok {
301+
p.UpdateCacheChannel <- cloned
302+
}
301303
return resp, nil
302304
}
303305

0 commit comments

Comments
 (0)