Skip to content

Commit

Permalink
Update generate_msgtypes.sh now that iota is gone
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Oct 22, 2020
1 parent ecfcb00 commit 6c2f589
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions helper/raftutil/generate_msgtypes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ var msgTypeNames = map[structs.MessageType]string{
EOF

cat ../../nomad/structs/structs.go \
| grep -A500 'MessageType = iota' \
| grep -v -e '//' \
| grep -A500 'MessageType = 0' \
| grep -v -e '//' \
| grep -v -e '^$' \
| awk '/^\)$/ { exit; } /.*/ { printf " structs.%s: \"%s\",\n", $1, $1}'

echo '}'
}

echo "==> Generating type map..."
generate_file > msgtypes.go

echo "==> Formatting type map..."
gofmt -w msgtypes.go
2 changes: 2 additions & 0 deletions helper/raftutil/msgtypes.go

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

0 comments on commit 6c2f589

Please sign in to comment.