diff --git a/main.go b/main.go index 24d1f9a..8dd5694 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( const warning = "//WARNING! DO NOT EDIT THIS FILE BY HAND. IT IS AUTO GENERATED.\n" -const header = "package main\nconst gitVersion = \"" +const header = "package main\n" const code = ` import ( @@ -25,7 +25,7 @@ func init() { } } } -` +const gitVersion = "` func main() { cmd := exec.Command("git", "describe", "--tags", "--abbrev=0") @@ -36,7 +36,7 @@ func main() { } version := string(out) version = version[:len(version)-1] - content := warning + header + version + "\"" + code + content := warning + header + code + version + "\"" ioutil.WriteFile("version.go", []byte(content), 0644) }