Skip to content

Commit

Permalink
feat(protoc): expose ContainsWildcard on multipattern
Browse files Browse the repository at this point in the history
Resource name structs have a ContainsWildcard() method. To simplify
checking this on multi-pattern resource names, exposing this on the
multipattern interface makes it easy to check without figuring out the
underlying type first.
  • Loading branch information
radhus committed Nov 22, 2023
1 parent d5003bb commit 0041801
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/protoc-gen-go-aip/internal/genaip/resourcename.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func (r resourceNameCodeGenerator) generateMultiPatternInterface(g *protogen.Gen
g.P("type ", r.MultiPatternInterfaceName(), " interface {")
g.P(fmtStringer)
g.P("MarshalString() (string, error)")
g.P("ContainsWildcard() bool")
g.P("}")
return nil
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0041801

Please sign in to comment.