From d47745a86b00fe1122d8ebd5e17601aa1b7552b2 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 17 Aug 2021 10:10:41 +0200 Subject: [PATCH] all: Update build constraints to Go 1.17 style (#7894) --- build.go | 1 + cmd/strelaypoolsrv/auto/noassets.go | 3 ++- cmd/syncthing/openurl_unix.go | 1 + cmd/syncthing/openurl_windows.go | 1 + cmd/syncthing/options_others.go | 1 + cmd/syncthing/perfstats_unix.go | 1 + cmd/syncthing/perfstats_unsupported.go | 1 + cmd/syncthing/traceback.go | 3 ++- lib/api/auto/noassets.go | 3 ++- lib/build/tags_race.go | 3 ++- lib/connections/quic_dial.go | 1 + lib/connections/quic_listen.go | 1 + lib/connections/quic_misc.go | 1 + lib/connections/quic_unsupported.go | 1 + lib/dialer/control_unix.go | 1 + lib/dialer/control_unsupported.go | 1 + lib/dialer/control_windows.go | 1 + lib/fs/basicfs_copy_range_copyfilerange.go | 1 + lib/fs/basicfs_copy_range_duplicateextents.go | 1 + lib/fs/basicfs_copy_range_ioctl.go | 1 + lib/fs/basicfs_copy_range_sendfile.go | 1 + lib/fs/basicfs_fileinfo_unix.go | 1 + lib/fs/basicfs_lstat_broken.go | 1 + lib/fs/basicfs_lstat_regular.go | 1 + lib/fs/basicfs_lstat_windows.go | 1 + lib/fs/basicfs_unix.go | 1 + lib/fs/basicfs_watch.go | 1 + lib/fs/basicfs_watch_errors_linux.go | 1 + lib/fs/basicfs_watch_errors_others.go | 1 + lib/fs/basicfs_watch_eventtypes_darwin.go | 1 + lib/fs/basicfs_watch_eventtypes_fen.go | 1 + lib/fs/basicfs_watch_eventtypes_inotify.go | 1 + lib/fs/basicfs_watch_eventtypes_kqueue.go | 1 + lib/fs/basicfs_watch_eventtypes_other.go | 1 + lib/fs/basicfs_watch_eventtypes_readdcw.go | 1 + lib/fs/basicfs_watch_test.go | 1 + lib/fs/basicfs_watch_unsupported.go | 1 + lib/fs/basicfs_windows.go | 1 + lib/fs/basicfs_windows_test.go | 1 + lib/fs/debug_symlink_unix.go | 1 + lib/osutil/atomic_unix_test.go | 3 ++- lib/osutil/filenames_unix.go | 1 + lib/osutil/hidden_unix.go | 1 + lib/osutil/hidden_windows.go | 1 + lib/osutil/lowprio_linux.go | 1 + lib/osutil/lowprio_unix.go | 1 + lib/osutil/rlimit_unix.go | 1 + lib/osutil/rlimit_windows.go | 1 + lib/protocol/nativemodel_darwin.go | 1 + lib/protocol/nativemodel_unix.go | 1 + lib/protocol/nativemodel_windows.go | 1 + lib/syncthing/superuser_unix.go | 1 + lib/upgrade/upgrade_supported.go | 1 + lib/upgrade/upgrade_test.go | 1 + lib/upgrade/upgrade_unsupp.go | 1 + lib/ur/memsize_solaris.go | 1 + lib/ur/memsize_unimpl.go | 1 + script/authors.go | 1 + script/commit-msg.go | 1 + script/genassets.go | 1 + script/prune_mocks.go | 1 + script/transifexdl.go | 1 + script/translate.go | 1 + test/cli_test.go | 1 + test/conflict_test.go | 1 + test/delay_scan_test.go | 1 + test/filetype_test.go | 1 + test/http_test.go | 1 + test/ignore_test.go | 1 + test/manypeers_test.go | 1 + test/override_test.go | 1 + test/parallell_scan_test.go | 1 + test/reconnect_test.go | 1 + test/reset_test.go | 1 + test/scan_test.go | 1 + test/symlink_test.go | 1 + test/sync_test.go | 1 + test/transfer-bench_test.go | 1 + test/usage_unix.go | 1 + test/usage_windows.go | 1 + test/util.go | 1 + 81 files changed, 86 insertions(+), 5 deletions(-) diff --git a/build.go b/build.go index dd6105674..d2a669e28 100644 --- a/build.go +++ b/build.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore package main diff --git a/cmd/strelaypoolsrv/auto/noassets.go b/cmd/strelaypoolsrv/auto/noassets.go index f8fa5e06d..9251e08e0 100644 --- a/cmd/strelaypoolsrv/auto/noassets.go +++ b/cmd/strelaypoolsrv/auto/noassets.go @@ -4,7 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -//+build noassets +//go:build noassets +// +build noassets package auto diff --git a/cmd/syncthing/openurl_unix.go b/cmd/syncthing/openurl_unix.go index 37cc8258c..5867a5c19 100644 --- a/cmd/syncthing/openurl_unix.go +++ b/cmd/syncthing/openurl_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package main diff --git a/cmd/syncthing/openurl_windows.go b/cmd/syncthing/openurl_windows.go index b55c0f12c..2f5eca8ef 100644 --- a/cmd/syncthing/openurl_windows.go +++ b/cmd/syncthing/openurl_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package main diff --git a/cmd/syncthing/options_others.go b/cmd/syncthing/options_others.go index 2fce60e66..b1f4764ca 100644 --- a/cmd/syncthing/options_others.go +++ b/cmd/syncthing/options_others.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package main diff --git a/cmd/syncthing/perfstats_unix.go b/cmd/syncthing/perfstats_unix.go index 4ec20b3ef..6da5a2116 100644 --- a/cmd/syncthing/perfstats_unix.go +++ b/cmd/syncthing/perfstats_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !solaris && !windows // +build !solaris,!windows package main diff --git a/cmd/syncthing/perfstats_unsupported.go b/cmd/syncthing/perfstats_unsupported.go index 7621fe2d3..2b7c07ba7 100644 --- a/cmd/syncthing/perfstats_unsupported.go +++ b/cmd/syncthing/perfstats_unsupported.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build solaris || windows // +build solaris windows package main diff --git a/cmd/syncthing/traceback.go b/cmd/syncthing/traceback.go index 16d2d23ba..746bb2d87 100644 --- a/cmd/syncthing/traceback.go +++ b/cmd/syncthing/traceback.go @@ -4,7 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -//+build go1.7 +//go:build go1.7 +// +build go1.7 package main diff --git a/lib/api/auto/noassets.go b/lib/api/auto/noassets.go index 06e726c09..977d3d4a4 100644 --- a/lib/api/auto/noassets.go +++ b/lib/api/auto/noassets.go @@ -4,7 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -//+build noassets +//go:build noassets +// +build noassets package auto diff --git a/lib/build/tags_race.go b/lib/build/tags_race.go index 4aa471587..cbcc5b9c7 100644 --- a/lib/build/tags_race.go +++ b/lib/build/tags_race.go @@ -4,7 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -//+build race +//go:build race +// +build race package build diff --git a/lib/connections/quic_dial.go b/lib/connections/quic_dial.go index 46e397b7a..ae55eef0f 100644 --- a/lib/connections/quic_dial.go +++ b/lib/connections/quic_dial.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build go1.14 && !noquic && !go1.17 // +build go1.14,!noquic,!go1.17 package connections diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go index 0bf08a05f..ea9d9e006 100644 --- a/lib/connections/quic_listen.go +++ b/lib/connections/quic_listen.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build go1.14 && !noquic && !go1.17 // +build go1.14,!noquic,!go1.17 package connections diff --git a/lib/connections/quic_misc.go b/lib/connections/quic_misc.go index ddf343822..d0b287260 100644 --- a/lib/connections/quic_misc.go +++ b/lib/connections/quic_misc.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build go1.14 && !noquic && !go1.17 // +build go1.14,!noquic,!go1.17 package connections diff --git a/lib/connections/quic_unsupported.go b/lib/connections/quic_unsupported.go index 7b1570767..8f91c9434 100644 --- a/lib/connections/quic_unsupported.go +++ b/lib/connections/quic_unsupported.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build noquic || !go1.14 || go1.17 // +build noquic !go1.14 go1.17 package connections diff --git a/lib/dialer/control_unix.go b/lib/dialer/control_unix.go index 948fed00d..f5060cb09 100644 --- a/lib/dialer/control_unix.go +++ b/lib/dialer/control_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !solaris && !windows // +build !solaris,!windows package dialer diff --git a/lib/dialer/control_unsupported.go b/lib/dialer/control_unsupported.go index 2fd50a7c0..835525d4f 100644 --- a/lib/dialer/control_unsupported.go +++ b/lib/dialer/control_unsupported.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build solaris // +build solaris package dialer diff --git a/lib/dialer/control_windows.go b/lib/dialer/control_windows.go index cd799f28f..289921f7d 100644 --- a/lib/dialer/control_windows.go +++ b/lib/dialer/control_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package dialer diff --git a/lib/fs/basicfs_copy_range_copyfilerange.go b/lib/fs/basicfs_copy_range_copyfilerange.go index 1dbf0c320..e7a814863 100644 --- a/lib/fs/basicfs_copy_range_copyfilerange.go +++ b/lib/fs/basicfs_copy_range_copyfilerange.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build linux // +build linux package fs diff --git a/lib/fs/basicfs_copy_range_duplicateextents.go b/lib/fs/basicfs_copy_range_duplicateextents.go index bdef5d39a..cdc587e57 100644 --- a/lib/fs/basicfs_copy_range_duplicateextents.go +++ b/lib/fs/basicfs_copy_range_duplicateextents.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package fs diff --git a/lib/fs/basicfs_copy_range_ioctl.go b/lib/fs/basicfs_copy_range_ioctl.go index 984bcadab..3c7cdbaad 100644 --- a/lib/fs/basicfs_copy_range_ioctl.go +++ b/lib/fs/basicfs_copy_range_ioctl.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build linux // +build linux package fs diff --git a/lib/fs/basicfs_copy_range_sendfile.go b/lib/fs/basicfs_copy_range_sendfile.go index 94239a5dd..5b68d66fd 100644 --- a/lib/fs/basicfs_copy_range_sendfile.go +++ b/lib/fs/basicfs_copy_range_sendfile.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build linux || solaris // +build linux solaris package fs diff --git a/lib/fs/basicfs_fileinfo_unix.go b/lib/fs/basicfs_fileinfo_unix.go index c21ba3807..cac1f451e 100644 --- a/lib/fs/basicfs_fileinfo_unix.go +++ b/lib/fs/basicfs_fileinfo_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package fs diff --git a/lib/fs/basicfs_lstat_broken.go b/lib/fs/basicfs_lstat_broken.go index e9c4ceee9..d2678a4f1 100644 --- a/lib/fs/basicfs_lstat_broken.go +++ b/lib/fs/basicfs_lstat_broken.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build linux || android // +build linux android package fs diff --git a/lib/fs/basicfs_lstat_regular.go b/lib/fs/basicfs_lstat_regular.go index 70ec2f8be..e3a6176d3 100644 --- a/lib/fs/basicfs_lstat_regular.go +++ b/lib/fs/basicfs_lstat_regular.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !linux && !android && !windows // +build !linux,!android,!windows package fs diff --git a/lib/fs/basicfs_lstat_windows.go b/lib/fs/basicfs_lstat_windows.go index 0522e6845..ec0e8038d 100644 --- a/lib/fs/basicfs_lstat_windows.go +++ b/lib/fs/basicfs_lstat_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package fs diff --git a/lib/fs/basicfs_unix.go b/lib/fs/basicfs_unix.go index 5571588f7..3d6a9bfd7 100644 --- a/lib/fs/basicfs_unix.go +++ b/lib/fs/basicfs_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package fs diff --git a/lib/fs/basicfs_watch.go b/lib/fs/basicfs_watch.go index e2437ec7c..583b45995 100644 --- a/lib/fs/basicfs_watch.go +++ b/lib/fs/basicfs_watch.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build (!solaris && !darwin) || (solaris && cgo) || (darwin && cgo) // +build !solaris,!darwin solaris,cgo darwin,cgo package fs diff --git a/lib/fs/basicfs_watch_errors_linux.go b/lib/fs/basicfs_watch_errors_linux.go index b8f838661..dfd472258 100644 --- a/lib/fs/basicfs_watch_errors_linux.go +++ b/lib/fs/basicfs_watch_errors_linux.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build linux // +build linux package fs diff --git a/lib/fs/basicfs_watch_errors_others.go b/lib/fs/basicfs_watch_errors_others.go index dc3ef38b8..384997466 100644 --- a/lib/fs/basicfs_watch_errors_others.go +++ b/lib/fs/basicfs_watch_errors_others.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build !linux // +build !linux package fs diff --git a/lib/fs/basicfs_watch_eventtypes_darwin.go b/lib/fs/basicfs_watch_eventtypes_darwin.go index c7fae5d14..8968c50db 100644 --- a/lib/fs/basicfs_watch_eventtypes_darwin.go +++ b/lib/fs/basicfs_watch_eventtypes_darwin.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build darwin && !kqueue && cgo // +build darwin,!kqueue,cgo package fs diff --git a/lib/fs/basicfs_watch_eventtypes_fen.go b/lib/fs/basicfs_watch_eventtypes_fen.go index 3c3d99b0b..bba5584a0 100644 --- a/lib/fs/basicfs_watch_eventtypes_fen.go +++ b/lib/fs/basicfs_watch_eventtypes_fen.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build solaris && cgo // +build solaris,cgo package fs diff --git a/lib/fs/basicfs_watch_eventtypes_inotify.go b/lib/fs/basicfs_watch_eventtypes_inotify.go index 75655918d..bc06bf564 100644 --- a/lib/fs/basicfs_watch_eventtypes_inotify.go +++ b/lib/fs/basicfs_watch_eventtypes_inotify.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build linux // +build linux package fs diff --git a/lib/fs/basicfs_watch_eventtypes_kqueue.go b/lib/fs/basicfs_watch_eventtypes_kqueue.go index a14930288..af6fd0186 100644 --- a/lib/fs/basicfs_watch_eventtypes_kqueue.go +++ b/lib/fs/basicfs_watch_eventtypes_kqueue.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build dragonfly || freebsd || netbsd || openbsd // +build dragonfly freebsd netbsd openbsd package fs diff --git a/lib/fs/basicfs_watch_eventtypes_other.go b/lib/fs/basicfs_watch_eventtypes_other.go index 7e6c23df3..beb38e7db 100644 --- a/lib/fs/basicfs_watch_eventtypes_other.go +++ b/lib/fs/basicfs_watch_eventtypes_other.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build !linux && !windows && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !darwin && !cgo // +build !linux,!windows,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!darwin,!cgo // Catch all platforms that are not specifically handled to use the generic diff --git a/lib/fs/basicfs_watch_eventtypes_readdcw.go b/lib/fs/basicfs_watch_eventtypes_readdcw.go index b9b73f303..5d4aa68f2 100644 --- a/lib/fs/basicfs_watch_eventtypes_readdcw.go +++ b/lib/fs/basicfs_watch_eventtypes_readdcw.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package fs diff --git a/lib/fs/basicfs_watch_test.go b/lib/fs/basicfs_watch_test.go index 9be15dc84..f5f683a66 100644 --- a/lib/fs/basicfs_watch_test.go +++ b/lib/fs/basicfs_watch_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build (!solaris && !darwin) || (solaris && cgo) || (darwin && cgo) // +build !solaris,!darwin solaris,cgo darwin,cgo package fs diff --git a/lib/fs/basicfs_watch_unsupported.go b/lib/fs/basicfs_watch_unsupported.go index 1bb37dd0c..753eb6813 100644 --- a/lib/fs/basicfs_watch_unsupported.go +++ b/lib/fs/basicfs_watch_unsupported.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build (solaris && !cgo) || (darwin && !cgo) // +build solaris,!cgo darwin,!cgo package fs diff --git a/lib/fs/basicfs_windows.go b/lib/fs/basicfs_windows.go index e4924da0e..d23f03863 100644 --- a/lib/fs/basicfs_windows.go +++ b/lib/fs/basicfs_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package fs diff --git a/lib/fs/basicfs_windows_test.go b/lib/fs/basicfs_windows_test.go index 6305377f4..ab2f74300 100644 --- a/lib/fs/basicfs_windows_test.go +++ b/lib/fs/basicfs_windows_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package fs diff --git a/lib/fs/debug_symlink_unix.go b/lib/fs/debug_symlink_unix.go index d075197eb..140370462 100644 --- a/lib/fs/debug_symlink_unix.go +++ b/lib/fs/debug_symlink_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package fs diff --git a/lib/osutil/atomic_unix_test.go b/lib/osutil/atomic_unix_test.go index 1bcae9d65..ec4f8e68e 100644 --- a/lib/osutil/atomic_unix_test.go +++ b/lib/osutil/atomic_unix_test.go @@ -4,7 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -//+build !windows +//go:build !windows +// +build !windows // (No syscall.Umask or the equivalent on Windows) diff --git a/lib/osutil/filenames_unix.go b/lib/osutil/filenames_unix.go index 3f595d053..5fab42520 100644 --- a/lib/osutil/filenames_unix.go +++ b/lib/osutil/filenames_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows && !darwin // +build !windows,!darwin package osutil diff --git a/lib/osutil/hidden_unix.go b/lib/osutil/hidden_unix.go index 6e772c38a..0602aff42 100644 --- a/lib/osutil/hidden_unix.go +++ b/lib/osutil/hidden_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package osutil diff --git a/lib/osutil/hidden_windows.go b/lib/osutil/hidden_windows.go index 00fd4972f..9a7d143a6 100644 --- a/lib/osutil/hidden_windows.go +++ b/lib/osutil/hidden_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package osutil diff --git a/lib/osutil/lowprio_linux.go b/lib/osutil/lowprio_linux.go index 99fd57deb..dd47c7cb3 100644 --- a/lib/osutil/lowprio_linux.go +++ b/lib/osutil/lowprio_linux.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !android // +build !android package osutil diff --git a/lib/osutil/lowprio_unix.go b/lib/osutil/lowprio_unix.go index bf0fb012f..595cdfa76 100644 --- a/lib/osutil/lowprio_unix.go +++ b/lib/osutil/lowprio_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build (!windows && !linux) || android // +build !windows,!linux android package osutil diff --git a/lib/osutil/rlimit_unix.go b/lib/osutil/rlimit_unix.go index 5b95dc481..32317bac2 100644 --- a/lib/osutil/rlimit_unix.go +++ b/lib/osutil/rlimit_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package osutil diff --git a/lib/osutil/rlimit_windows.go b/lib/osutil/rlimit_windows.go index 0a589f4d4..7a7606336 100644 --- a/lib/osutil/rlimit_windows.go +++ b/lib/osutil/rlimit_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build windows // +build windows package osutil diff --git a/lib/protocol/nativemodel_darwin.go b/lib/protocol/nativemodel_darwin.go index 68b6ba985..b08c8fac3 100644 --- a/lib/protocol/nativemodel_darwin.go +++ b/lib/protocol/nativemodel_darwin.go @@ -1,5 +1,6 @@ // Copyright (C) 2014 The Protocol Authors. +//go:build darwin // +build darwin package protocol diff --git a/lib/protocol/nativemodel_unix.go b/lib/protocol/nativemodel_unix.go index ea6ec8dbd..9aa094491 100644 --- a/lib/protocol/nativemodel_unix.go +++ b/lib/protocol/nativemodel_unix.go @@ -1,5 +1,6 @@ // Copyright (C) 2014 The Protocol Authors. +//go:build !windows && !darwin // +build !windows,!darwin package protocol diff --git a/lib/protocol/nativemodel_windows.go b/lib/protocol/nativemodel_windows.go index 00eab9b3f..da91c7949 100644 --- a/lib/protocol/nativemodel_windows.go +++ b/lib/protocol/nativemodel_windows.go @@ -1,5 +1,6 @@ // Copyright (C) 2014 The Protocol Authors. +//go:build windows // +build windows package protocol diff --git a/lib/syncthing/superuser_unix.go b/lib/syncthing/superuser_unix.go index 1bea5a691..4e7603422 100644 --- a/lib/syncthing/superuser_unix.go +++ b/lib/syncthing/superuser_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !windows // +build !windows package syncthing diff --git a/lib/upgrade/upgrade_supported.go b/lib/upgrade/upgrade_supported.go index b18c8b124..45eeaf426 100644 --- a/lib/upgrade/upgrade_supported.go +++ b/lib/upgrade/upgrade_supported.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !noupgrade // +build !noupgrade package upgrade diff --git a/lib/upgrade/upgrade_test.go b/lib/upgrade/upgrade_test.go index 38fd4232e..8e2ec2ccd 100644 --- a/lib/upgrade/upgrade_test.go +++ b/lib/upgrade/upgrade_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build !noupgrade // +build !noupgrade package upgrade diff --git a/lib/upgrade/upgrade_unsupp.go b/lib/upgrade/upgrade_unsupp.go index 30e847e5b..b442024d2 100644 --- a/lib/upgrade/upgrade_unsupp.go +++ b/lib/upgrade/upgrade_unsupp.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build noupgrade // +build noupgrade package upgrade diff --git a/lib/ur/memsize_solaris.go b/lib/ur/memsize_solaris.go index cd805b736..4614dad33 100644 --- a/lib/ur/memsize_solaris.go +++ b/lib/ur/memsize_solaris.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build solaris // +build solaris package ur diff --git a/lib/ur/memsize_unimpl.go b/lib/ur/memsize_unimpl.go index 5a80b1a27..d1c576c80 100644 --- a/lib/ur/memsize_unimpl.go +++ b/lib/ur/memsize_unimpl.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build freebsd || openbsd || dragonfly // +build freebsd openbsd dragonfly package ur diff --git a/script/authors.go b/script/authors.go index dfe927d68..3068aebd5 100644 --- a/script/authors.go +++ b/script/authors.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore // Generates the list of contributors in gui/index.html based on contents of diff --git a/script/commit-msg.go b/script/commit-msg.go index 474c605bd..c5e178dea 100644 --- a/script/commit-msg.go +++ b/script/commit-msg.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore package main diff --git a/script/genassets.go b/script/genassets.go index f41c17187..71f965ab9 100644 --- a/script/genassets.go +++ b/script/genassets.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore package main diff --git a/script/prune_mocks.go b/script/prune_mocks.go index ccc10cee9..ba9241027 100644 --- a/script/prune_mocks.go +++ b/script/prune_mocks.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore package main diff --git a/script/transifexdl.go b/script/transifexdl.go index cf8df784f..321bdab6f 100644 --- a/script/transifexdl.go +++ b/script/transifexdl.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore package main diff --git a/script/translate.go b/script/translate.go index 12a7def82..d311f000b 100644 --- a/script/translate.go +++ b/script/translate.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build ignore // +build ignore package main diff --git a/test/cli_test.go b/test/cli_test.go index 495bf9f8a..f8e783893 100644 --- a/test/cli_test.go +++ b/test/cli_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/conflict_test.go b/test/conflict_test.go index bc4ae1f2f..c163dbb56 100644 --- a/test/conflict_test.go +++ b/test/conflict_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/delay_scan_test.go b/test/delay_scan_test.go index 2b907a7a9..8b451c982 100644 --- a/test/delay_scan_test.go +++ b/test/delay_scan_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/filetype_test.go b/test/filetype_test.go index caf6fc646..a6e4987a8 100644 --- a/test/filetype_test.go +++ b/test/filetype_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/http_test.go b/test/http_test.go index 53d1124a7..a00bdb7d2 100644 --- a/test/http_test.go +++ b/test/http_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/ignore_test.go b/test/ignore_test.go index 8adb5b449..5022026c0 100644 --- a/test/ignore_test.go +++ b/test/ignore_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/manypeers_test.go b/test/manypeers_test.go index 5cbd31efc..0e65f81f0 100644 --- a/test/manypeers_test.go +++ b/test/manypeers_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/override_test.go b/test/override_test.go index 68b09725f..a4af61bf5 100644 --- a/test/override_test.go +++ b/test/override_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/parallell_scan_test.go b/test/parallell_scan_test.go index 8bfa3684f..e3f35f2b7 100644 --- a/test/parallell_scan_test.go +++ b/test/parallell_scan_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/reconnect_test.go b/test/reconnect_test.go index d2557ba99..b002f084e 100644 --- a/test/reconnect_test.go +++ b/test/reconnect_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/reset_test.go b/test/reset_test.go index aa5aa6c2a..1e781c7e3 100644 --- a/test/reset_test.go +++ b/test/reset_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/scan_test.go b/test/scan_test.go index e2ebbb6da..32ad81b9f 100644 --- a/test/scan_test.go +++ b/test/scan_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/symlink_test.go b/test/symlink_test.go index 423c421d6..87cf2ac26 100644 --- a/test/symlink_test.go +++ b/test/symlink_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/sync_test.go b/test/sync_test.go index 686ab67c8..0029c7c10 100644 --- a/test/sync_test.go +++ b/test/sync_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration diff --git a/test/transfer-bench_test.go b/test/transfer-bench_test.go index 70e26a722..29a9e5095 100644 --- a/test/transfer-bench_test.go +++ b/test/transfer-bench_test.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration && benchmark // +build integration,benchmark package integration diff --git a/test/usage_unix.go b/test/usage_unix.go index 87b3e1bcc..a0dc157ec 100644 --- a/test/usage_unix.go +++ b/test/usage_unix.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build integration && benchmark && !windows // +build integration,benchmark,!windows package integration diff --git a/test/usage_windows.go b/test/usage_windows.go index 52e24baac..883473960 100644 --- a/test/usage_windows.go +++ b/test/usage_windows.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at http://mozilla.org/MPL/2.0/. +//go:build integration && benchmark && windows // +build integration,benchmark,windows package integration diff --git a/test/util.go b/test/util.go index 5612cdf07..38b00a5a7 100644 --- a/test/util.go +++ b/test/util.go @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. +//go:build integration // +build integration package integration