From 8b7917cd811c22801eb98868284cccbef42dfc2e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 26 Jul 2021 14:09:12 +0300 Subject: [PATCH] all: add `go:build` lines for Go1.17 See https://tip.golang.org/doc/go1.17#gofmt for more details --- app/vmselect/promql/tzdata.go | 1 + lib/encoding/encoding_cgo_test.go | 1 + lib/encoding/encoding_pure_test.go | 1 + lib/encoding/zstd/zstd_cgo.go | 1 + lib/encoding/zstd/zstd_pure.go | 1 + lib/encoding/zstd/zstd_test.go | 1 + lib/fs/fadvise_unix.go | 1 + lib/fs/fs_nix.go | 3 ++- lib/fs/fs_unix.go | 3 ++- lib/logger/tzdata.go | 1 + lib/memory/memory_bsd.go | 1 + lib/memory/sysctl.go | 1 + lib/procutil/signal.go | 1 + lib/procutil/signal_windows.go | 1 + 14 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/vmselect/promql/tzdata.go b/app/vmselect/promql/tzdata.go index c513285bd..f2e2b4804 100644 --- a/app/vmselect/promql/tzdata.go +++ b/app/vmselect/promql/tzdata.go @@ -1,3 +1,4 @@ +//go:build go1.15 // +build go1.15 package promql diff --git a/lib/encoding/encoding_cgo_test.go b/lib/encoding/encoding_cgo_test.go index b85c5f9d5..e7e8da1a3 100644 --- a/lib/encoding/encoding_cgo_test.go +++ b/lib/encoding/encoding_cgo_test.go @@ -1,3 +1,4 @@ +//go:build cgo // +build cgo package encoding diff --git a/lib/encoding/encoding_pure_test.go b/lib/encoding/encoding_pure_test.go index 332110252..ece4f5395 100644 --- a/lib/encoding/encoding_pure_test.go +++ b/lib/encoding/encoding_pure_test.go @@ -1,3 +1,4 @@ +//go:build !cgo // +build !cgo package encoding diff --git a/lib/encoding/zstd/zstd_cgo.go b/lib/encoding/zstd/zstd_cgo.go index 9484aa2b3..b38a48e42 100644 --- a/lib/encoding/zstd/zstd_cgo.go +++ b/lib/encoding/zstd/zstd_cgo.go @@ -1,3 +1,4 @@ +//go:build cgo // +build cgo package zstd diff --git a/lib/encoding/zstd/zstd_pure.go b/lib/encoding/zstd/zstd_pure.go index ba7662f8d..3fc666b9c 100644 --- a/lib/encoding/zstd/zstd_pure.go +++ b/lib/encoding/zstd/zstd_pure.go @@ -1,3 +1,4 @@ +//go:build !cgo // +build !cgo package zstd diff --git a/lib/encoding/zstd/zstd_test.go b/lib/encoding/zstd/zstd_test.go index 29d298e57..6f7f63b1c 100644 --- a/lib/encoding/zstd/zstd_test.go +++ b/lib/encoding/zstd/zstd_test.go @@ -1,3 +1,4 @@ +//go:build cgo // +build cgo package zstd diff --git a/lib/fs/fadvise_unix.go b/lib/fs/fadvise_unix.go index 1af313b04..b0d4bdf71 100644 --- a/lib/fs/fadvise_unix.go +++ b/lib/fs/fadvise_unix.go @@ -1,3 +1,4 @@ +//go:build linux || freebsd // +build linux freebsd package fs diff --git a/lib/fs/fs_nix.go b/lib/fs/fs_nix.go index 32df8e641..96d37d77f 100644 --- a/lib/fs/fs_nix.go +++ b/lib/fs/fs_nix.go @@ -1,4 +1,5 @@ -// +build linux darwin freebsd +//go:build linux || darwin || freebsd +// +build linux darwin freebsd package fs diff --git a/lib/fs/fs_unix.go b/lib/fs/fs_unix.go index 11df30c8b..20cf6f6c0 100644 --- a/lib/fs/fs_unix.go +++ b/lib/fs/fs_unix.go @@ -1,4 +1,5 @@ -// +build linux darwin freebsd openbsd +//go:build linux || darwin || freebsd || openbsd +// +build linux darwin freebsd openbsd package fs diff --git a/lib/logger/tzdata.go b/lib/logger/tzdata.go index 3947978f2..d2efe9f0d 100644 --- a/lib/logger/tzdata.go +++ b/lib/logger/tzdata.go @@ -1,3 +1,4 @@ +//go:build go1.15 // +build go1.15 package logger diff --git a/lib/memory/memory_bsd.go b/lib/memory/memory_bsd.go index 238caec76..4955ef6e9 100644 --- a/lib/memory/memory_bsd.go +++ b/lib/memory/memory_bsd.go @@ -1,3 +1,4 @@ +//go:build freebsd || openbsd || dragonfly || netbsd // +build freebsd openbsd dragonfly netbsd package memory diff --git a/lib/memory/sysctl.go b/lib/memory/sysctl.go index 950a22cba..1c31e0978 100644 --- a/lib/memory/sysctl.go +++ b/lib/memory/sysctl.go @@ -1,3 +1,4 @@ +//go:build darwin || freebsd || openbsd || dragonfly || netbsd // +build darwin freebsd openbsd dragonfly netbsd package memory diff --git a/lib/procutil/signal.go b/lib/procutil/signal.go index 7076b0b71..58a863461 100644 --- a/lib/procutil/signal.go +++ b/lib/procutil/signal.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package procutil diff --git a/lib/procutil/signal_windows.go b/lib/procutil/signal_windows.go index 6b16aee73..1a1d32e0a 100644 --- a/lib/procutil/signal_windows.go +++ b/lib/procutil/signal_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package procutil