From ff0930a94dae185bb24e32083e9c80a20bc12301 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Mon, 15 Nov 2021 15:37:56 +0600 Subject: [PATCH] New build contraints format --- cgo_symbolizer.go | 2 +- go.mod | 2 +- memory/free.go | 2 +- memory/free_linux.go | 2 +- pprof.go | 2 +- reuseport/listen_no_reuseport.go | 4 +++- reuseport/listen_reuseport.go | 3 +-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cgo_symbolizer.go b/cgo_symbolizer.go index c0110925..b5a1860d 100644 --- a/cgo_symbolizer.go +++ b/cgo_symbolizer.go @@ -1,4 +1,4 @@ -// +build linux darwin +//go:build linux || darwin package main diff --git a/go.mod b/go.mod index d36ba68a..6b7c51de 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/imgproxy/imgproxy/v3 -go 1.15 +go 1.16 require ( cloud.google.com/go/storage v1.18.2 diff --git a/memory/free.go b/memory/free.go index d4eb0f6c..c32b27d0 100644 --- a/memory/free.go +++ b/memory/free.go @@ -1,4 +1,4 @@ -// +build !linux +//go:build !linux package memory diff --git a/memory/free_linux.go b/memory/free_linux.go index bc727b32..8a964f6e 100644 --- a/memory/free_linux.go +++ b/memory/free_linux.go @@ -1,4 +1,4 @@ -// +build linux +//go:build linux package memory diff --git a/pprof.go b/pprof.go index 92bba0d0..657641f2 100644 --- a/pprof.go +++ b/pprof.go @@ -1,4 +1,4 @@ -// +build pprof +//go:build pprof package main diff --git a/reuseport/listen_no_reuseport.go b/reuseport/listen_no_reuseport.go index 81756c8f..d91ecc9e 100644 --- a/reuseport/listen_no_reuseport.go +++ b/reuseport/listen_no_reuseport.go @@ -1,9 +1,11 @@ -// +build !linux,!darwin !go1.11 +//go:build (!linux && !darwin) || !go1.11 package reuseport import ( "net" + + "github.com/imgproxy/imgproxy/v3/config" ) func Listen(network, address string) (net.Listener, error) { diff --git a/reuseport/listen_reuseport.go b/reuseport/listen_reuseport.go index 8c4bbe2d..7dd50976 100644 --- a/reuseport/listen_reuseport.go +++ b/reuseport/listen_reuseport.go @@ -1,5 +1,4 @@ -// +build linux darwin -// +build go1.11 +//go:build (linux || darwin) && go1.11 package reuseport