From 7b2e6b7fa3799ce686dd7509cf9cf6d9b94c2835 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 10 Jun 2014 09:46:00 -0400 Subject: Made adjustments to the output of windowsconstgen to please go fmt. --- tools/windowsconstgen.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/windowsconstgen.go b/tools/windowsconstgen.go index 777324d..37cdd22 100644 --- a/tools/windowsconstgen.go +++ b/tools/windowsconstgen.go @@ -104,7 +104,7 @@ func hacknamesPreamble() string { func preamble(pkg string) string { return "// autogenerated by windowsconstgen; do not edit\n" + - "package " + pkg + "\n" + "package " + pkg + "\n\n" // two newlines to please go fmt } // for backwards compatibiilty reasons, Windows defines GetWindowLongPtr()/SetWindowLongPtr() as a macro which expands to GetWindowLong()/SetWindowLong() on 32-bit systems @@ -118,6 +118,10 @@ func printConst(f *os.File, goconst string, winconst string) { fmt.Fprintf(f, " fmt.Println(\"const %s =\", C.%s)\n", goconst, winconst) } +func printBlankLine(f *os.File) { + fmt.Fprintf(f, " fmt.Println()\n") +} + func printGWLPName(f *os.File, which string, char string, targetarch string) { fmt.Fprintf(f, " fmt.Println(\"var %s = user32.NewProc(\\\"%s\\\")\")\n", which, char + gwlpNames[targetarch]) @@ -188,6 +192,7 @@ func main() { // not a hack name; strip the leading _ from the value name but keep the constant name unchanged printConst(f, ident, ident[1:]) } + printBlankLine(f) // to please go fmt // and now for _getWindowLongPtr/_setWindowLongPtr printGWLPName(f, "_getWindowLongPtr", "G", targetarch) printGWLPName(f, "_setWindowLongPtr", "S", targetarch) -- cgit v1.2.3