Updated the Windows constants generator to warn against variables that haven't been converted to constants (in case I forget I ever did this).

This commit is contained in:
Pietro Gagliardi 2014-05-25 11:35:55 -04:00
parent eb0188a099
commit 5583dee743
1 changed files with 8 additions and 1 deletions

View File

@ -97,11 +97,18 @@ func main() {
// keep sorted for git
consts := make([]string, 0, len(known))
vars := ""
for ident, kind := range known {
if kind == "const" || kind == "var" {
if kind == "var" {
vars += "\n" + ident
}
if kind == "const" {
consts = append(consts, ident)
}
}
if vars != "" {
panic("error: the following are still unknown!" + vars) // has a newline already
}
sort.Strings(consts)
// thanks to james4k in irc.freenode.net/#go-nuts