These changes address the following warning showing up on `go get`
operations:
go: module github.com/golang/protobuf is deprecated: Use the
"google.golang.org/protobuf" module instead.
All changes are made using the recommendations in the per-function
deprecation notices from the docs at
https://pkg.go.dev/github.com/golang/protobuf/ptypes
19 lines
374 B
Go
19 lines
374 B
Go
package core
|
|
|
|
import (
|
|
"github.com/hashicorp/go-argmapper"
|
|
"google.golang.org/protobuf/types/known/anypb"
|
|
)
|
|
|
|
// argNamedAny returns an argmapper.Arg that specifies the Any value
|
|
// with the proper subtype.
|
|
func argNamedAny(n string, v *anypb.Any) argmapper.Arg {
|
|
if v == nil {
|
|
return nil
|
|
}
|
|
|
|
msg := string(v.MessageName())
|
|
|
|
return argmapper.NamedSubtype(n, v, msg)
|
|
}
|