From 5583dee743f8b47e9dd04ecd24bde6950d1eca14 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 25 May 2014 11:35:55 -0400 Subject: [PATCH] Updated the Windows constants generator to warn against variables that haven't been converted to constants (in case I forget I ever did this). --- experiments/windowsconstgen.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/experiments/windowsconstgen.go b/experiments/windowsconstgen.go index 4ee1d76..05260cf 100644 --- a/experiments/windowsconstgen.go +++ b/experiments/windowsconstgen.go @@ -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