From 4bc2581b47c1d154494e7d30420f19decde51d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatko=20=C4=8Calu=C5=A1i=C4=87?= Date: Fri, 2 Jun 2017 08:52:04 +0200 Subject: [PATCH] Check version in build.go Print a sensible error for Go < 1.7 (the "context" package is missing there) https://github.com/restic/restic/commit/f8dd5d5088a777fb8c66ba88dadd938a76e91c6b --- build.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.go b/build.go index 15e92e4..fca292d 100644 --- a/build.go +++ b/build.go @@ -291,6 +291,12 @@ func (cs Constants) LDFlags() string { } func main() { + ver := runtime.Version() + if strings.HasPrefix(ver, "go1") && ver < "go1.7" { + fmt.Fprintf(os.Stderr, "Go version %s detected, restic requires at least Go 1.7\n", ver) + os.Exit(1) + } + buildTags := []string{} skipNext := false