1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 * Helpers for building runtime.
16 // mkzversion writes zversion.go:
19 // const defaultGoroot = <goroot>
20 // const theVersion = <version>
22 func mkzversion(dir, file string) {
24 "// auto generated by go tool dist\n"+
28 "const defaultGoroot = `%s`\n"+
29 "const theVersion = `%s`\n"+
30 "const goexperiment = `%s`\n"+
31 "var buildVersion = theVersion\n", goroot_final, goversion, os.Getenv("GOEXPERIMENT"))
33 writefile(out, file, 0)
36 // mkzbootstrap writes cmd/internal/obj/zbootstrap.go:
40 // const defaultGOROOT = <goroot>
41 // const defaultGOARM = <goarm>
42 // const defaultGOOS = <goos>
43 // const defaultGOARCH = <goarch>
44 // const version = <version>
45 // const goexperiment = <goexperiment>
47 func mkzbootstrap(file string) {
49 "// auto generated by go tool dist\n"+
53 "const defaultGOROOT = `%s`\n"+
54 "const defaultGOARM = `%s`\n"+
55 "const defaultGOOS = `%s`\n"+
56 "const defaultGOARCH = `%s`\n"+
57 "const version = `%s`\n"+
58 "const goexperiment = `%s`\n",
59 goroot_final, goarm, gohostos, gohostarch, goversion, os.Getenv("GOEXPERIMENT"))
61 writefile(out, file, 0)