Skip to content

Commit

Permalink
Merge pull request #829 from rainest/feat/error-duplicate-gen
Browse files Browse the repository at this point in the history
✨ Return an error for duplicate generators
  • Loading branch information
k8s-ci-robot committed Jul 11, 2023
2 parents 95ddbaf + 75e6573 commit 9378a61
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 9378a61

Please sign in to comment.