Skip to content

Commit

Permalink
Merge pull request #835 from k8s-infra-cherrypick-robot/cherry-pick-8…
Browse files Browse the repository at this point in the history
…29-to-release-0.12

[release-0.12] ✨ Return an error for duplicate generators
  • Loading branch information
k8s-ci-robot committed Jul 13, 2023
2 parents 3c09a34 + 35f6df7 commit 371c48c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/genall/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ func protoFromOptions(optionsRegistry *markers.Registry, options []string) (prot
switch val := val.(type) {
case Generator:
gens = append(gens, &val)
if _, alreadyExists := gensByName[defn.Name]; alreadyExists {
return protoRuntime{}, fmt.Errorf("multiple instances of '%s' generator specified", defn.Name)
}
gensByName[defn.Name] = &val
case OutputRule:
_, genName := splitOutputRuleOption(defn.Name)
Expand Down

0 comments on commit 371c48c

Please sign in to comment.