Skip to content

Commit

Permalink
generate: return "Unknown" for unknown NameForKey
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Apr 17, 2021
1 parent 55c8115 commit 26c1ea2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ func main() {
l.Write("// or \"\" if the key is unknown.")
l.Write("func NameForKey(key int16) string {")
l.Write("switch key {")
l.Write("default: return \"\"")
l.Write("default: return \"Unknown\"")
for _, key2struct := range name2structs {
l.Write("case %d: return \"%s\"", key2struct.Key, strings.TrimSuffix(key2struct.Name, "Request"))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kmsg/generated.go

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

0 comments on commit 26c1ea2

Please sign in to comment.