From 477071d673f0d7e91c837459d9098744a5ec7d59 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 23 Feb 2017 00:04:51 +0100 Subject: speed: fix build for Go 1.4 and lower Old Go versions miss cipher.NewGCMWithNonceSize, which causes: internal/speed/speed.go:95: undefined: cipher.NewGCMWithNonceSize --- internal/speed/speed.go | 2 ++ internal/speed/speed_go1.4.go | 11 +++++++++++ internal/speed/speed_test.go | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 internal/speed/speed_go1.4.go (limited to 'internal/speed') diff --git a/internal/speed/speed.go b/internal/speed/speed.go index f9bf93c..bc829d4 100644 --- a/internal/speed/speed.go +++ b/internal/speed/speed.go @@ -1,3 +1,5 @@ +// +build go1.5 + // Package speed implements the "-speed" command-line option, // similar to "openssl speed". // It benchmarks the crypto algorithms and libraries used by diff --git a/internal/speed/speed_go1.4.go b/internal/speed/speed_go1.4.go new file mode 100644 index 0000000..9c0125c --- /dev/null +++ b/internal/speed/speed_go1.4.go @@ -0,0 +1,11 @@ +// +build !go1.5 + +package speed + +import ( + "fmt" +) + +func Run() { + fmt.Printf("Compile with Go 1.5 or higher to run the benchmarks\n") +} diff --git a/internal/speed/speed_test.go b/internal/speed/speed_test.go index 1e9d859..d6bc187 100644 --- a/internal/speed/speed_test.go +++ b/internal/speed/speed_test.go @@ -1,3 +1,5 @@ +// +build go1.5 + package speed /* -- cgit v1.2.3