diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-25 13:02:56 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-25 13:02:56 -0400 |
| commit | 98933878482767320d1b9449a84647459f1f749b (patch) | |
| tree | 396624cee5ed4c9a141f7df39f710cab0b783c3f | |
| parent | 339a77b5d6c4f019f6979cd95ab73ff8540fd91a (diff) | |
Changed the logic of the Windows constants generator so that it only generates unknown constants and complains on known constants (though that's disabled during the transitional period) as that's the situation that will happen now.
| -rw-r--r-- | experiments/windowsconstgen.go | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/experiments/windowsconstgen.go b/experiments/windowsconstgen.go index 05260cf..6f76eb7 100644 --- a/experiments/windowsconstgen.go +++ b/experiments/windowsconstgen.go @@ -87,27 +87,23 @@ func main() { pkg := getPackage(pkgpath) gatherNames(pkg) - if len(unknown) > 0 { - s := "error: the following are still unknown!" - for k, _ := range unknown { - s += "\n" + k + // if we still have some known, I didn't clean things up completely + knowns := "" + for ident, kind := range known { + if kind != "var" && kind != "const" { + continue } - panic(s) + knowns += "\n" + ident + " (" + kind + ")" + } + if knowns != "" { +//ignore for now while I still migrate everything +// panic("error: the following are still known!" + knowns) // has a newline already } // keep sorted for git - consts := make([]string, 0, len(known)) - vars := "" - for ident, kind := range known { - 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 + consts := make([]string, 0, len(unknown)) + for ident, _ := range unknown { + consts = append(consts, ident) } sort.Strings(consts) |
