From f8dd5d5088a777fb8c66ba88dadd938a76e91c6b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 9 Mar 2017 11:29:24 +0100 Subject: [PATCH] Check version in build.go Print a sensible error for Go < 1.7 (the "context" package is missing there) --- build.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.go b/build.go index ec5566093..8a041df94 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