build: Don't check for supported Go version
One thing less to maintain, and you can discover for yourself if it builds or not.
This commit is contained in:
parent
0558565a95
commit
689f13f4f1
27
build.go
27
build.go
@ -203,8 +203,6 @@ func init() {
|
|||||||
targets["syncthing"] = syncthingPkg
|
targets["syncthing"] = syncthingPkg
|
||||||
}
|
}
|
||||||
|
|
||||||
const minGoVersion = 1.5
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.SetOutput(os.Stdout)
|
log.SetOutput(os.Stdout)
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
@ -220,9 +218,6 @@ func main() {
|
|||||||
setGoPath()
|
setGoPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use Go 1.5+ vendoring.
|
|
||||||
os.Setenv("GO15VENDOREXPERIMENT", "1")
|
|
||||||
|
|
||||||
// Set path to $GOPATH/bin:$PATH so that we can for sure find tools we
|
// Set path to $GOPATH/bin:$PATH so that we can for sure find tools we
|
||||||
// might have installed during "build.go setup".
|
// might have installed during "build.go setup".
|
||||||
os.Setenv("PATH", fmt.Sprintf("%s%cbin%c%s", os.Getenv("GOPATH"), os.PathSeparator, os.PathListSeparator, os.Getenv("PATH")))
|
os.Setenv("PATH", fmt.Sprintf("%s%cbin%c%s", os.Getenv("GOPATH"), os.PathSeparator, os.PathListSeparator, os.Getenv("PATH")))
|
||||||
@ -230,7 +225,6 @@ func main() {
|
|||||||
parseFlags()
|
parseFlags()
|
||||||
|
|
||||||
checkArchitecture()
|
checkArchitecture()
|
||||||
goVersion, _ = checkRequiredGoVersion()
|
|
||||||
|
|
||||||
// Invoking build.go with no parameters at all builds everything (incrementally),
|
// Invoking build.go with no parameters at all builds everything (incrementally),
|
||||||
// which is what you want for maximum error checking during development.
|
// which is what you want for maximum error checking during development.
|
||||||
@ -355,27 +349,6 @@ func parseFlags() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkRequiredGoVersion() (float64, bool) {
|
|
||||||
re := regexp.MustCompile(`go(\d+\.\d+)`)
|
|
||||||
ver := runtime.Version()
|
|
||||||
if m := re.FindStringSubmatch(ver); len(m) == 2 {
|
|
||||||
vs := string(m[1])
|
|
||||||
// This is a standard go build. Verify that it's new enough.
|
|
||||||
f, err := strconv.ParseFloat(vs, 64)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("*** Couldn't parse Go version out of %q.\n*** This isn't known to work, proceed on your own risk.", vs)
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
if f < minGoVersion {
|
|
||||||
log.Fatalf("*** Go version %.01f is less than required %.01f.\n*** This is known not to work, not proceeding.", f, minGoVersion)
|
|
||||||
}
|
|
||||||
return f, true
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("*** Unknown Go version %q.\n*** This isn't known to work, proceed on your own risk.", ver)
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
|
|
||||||
func setup() {
|
func setup() {
|
||||||
packages := []string{
|
packages := []string{
|
||||||
"github.com/alecthomas/gometalinter",
|
"github.com/alecthomas/gometalinter",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user