From e4fdb424964599db2e8d0ab273b6be804c6c9c12 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 2 Aug 2017 23:34:14 +0200 Subject: build.bash: implement "you need Go 1.5" lockout in pure Go As noticed by @riking, the logic in the bash script will break when Go 1 version numbers reach double-digits. Instead, use a build tag "!go1.5" to cause a syntax error: $ /opt/go1.4.3/bin/go build can't load package: package github.com/rfjakob/gocryptfs: go1.4.go:5:1: expected 'package', found 'STRING' "You need Go 1.5 or higher to compile gocryptfs!" Fixes https://github.com/rfjakob/gocryptfs/issues/133 --- go1.4.go | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 go1.4.go (limited to 'go1.4.go') diff --git a/go1.4.go b/go1.4.go new file mode 100644 index 0000000..939fe91 --- /dev/null +++ b/go1.4.go @@ -0,0 +1,5 @@ +// +build !go1.5 + +// Cause an early compile error on Go 1.4 an lower. We need Go 1.5 for a number +// of reasons, among them NewGCMWithNonceSize and RawURLEncoding. +"You need Go 1.5 or higher to compile gocryptfs!" -- cgit v1.2.3