From 689f13f4f173e307ab5a98f2a677e03e22219c49 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 5 Mar 2017 10:31:54 +0100 Subject: [PATCH] build: Don't check for supported Go version One thing less to maintain, and you can discover for yourself if it builds or not. --- build.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/build.go b/build.go index bdc5bbd6f..048d8d1b3 100644 --- a/build.go +++ b/build.go @@ -203,8 +203,6 @@ func init() { targets["syncthing"] = syncthingPkg } -const minGoVersion = 1.5 - func main() { log.SetOutput(os.Stdout) log.SetFlags(0) @@ -220,9 +218,6 @@ func main() { 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 // 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"))) @@ -230,7 +225,6 @@ func main() { parseFlags() checkArchitecture() - goVersion, _ = checkRequiredGoVersion() // Invoking build.go with no parameters at all builds everything (incrementally), // which is what you want for maximum error checking during development. @@ -355,27 +349,6 @@ func parseFlags() { 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() { packages := []string{ "github.com/alecthomas/gometalinter",