diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-08-26 14:31:08 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-01 08:35:51 +0300 |
commit | f635e1909d098c7b5d3ce4c71e08dc9b08e463f3 (patch) | |
tree | a344b0d16ace4ab5fe706946359e76982982a958 /cmd | |
parent | 50eff62c1b1f5730c7ca18597493b0b2926e72ca (diff) |
global: Support Go-1.17-style build tags
With Go 1.17, new syntax was introduced for build tags which has the
intent to be much easier to use compared to the previous `+build` ones.
To ease the migration, Go 1.17 supports both old-style and new-style
build tags, where the recommended migration path is to have both as long
as projects support older Go versions which don't yet know about the new
syntax.
Migrate our codebase to use both both styles. While we don't yet support
Go 1.17 officially, it doesn't hurt to be prepared, and furthermore it
fixes linting issues I have been observing on my machine.
Diffstat (limited to 'cmd')
28 files changed, 28 insertions, 0 deletions
diff --git a/cmd/gitaly-git2go/apply.go b/cmd/gitaly-git2go/apply.go index ed0bcbabe..d3bcfc597 100644 --- a/cmd/gitaly-git2go/apply.go +++ b/cmd/gitaly-git2go/apply.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/cherry_pick.go b/cmd/gitaly-git2go/cherry_pick.go index b186c7d6e..683b10d72 100644 --- a/cmd/gitaly-git2go/cherry_pick.go +++ b/cmd/gitaly-git2go/cherry_pick.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/cherry_pick_test.go b/cmd/gitaly-git2go/cherry_pick_test.go index 33d50e6f3..a205113da 100644 --- a/cmd/gitaly-git2go/cherry_pick_test.go +++ b/cmd/gitaly-git2go/cherry_pick_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/commit.go b/cmd/gitaly-git2go/commit.go index 6d2f62d58..33a8ff9a2 100644 --- a/cmd/gitaly-git2go/commit.go +++ b/cmd/gitaly-git2go/commit.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/commit/change_file_mode.go b/cmd/gitaly-git2go/commit/change_file_mode.go index 381ee3a4c..25ccd1dfb 100644 --- a/cmd/gitaly-git2go/commit/change_file_mode.go +++ b/cmd/gitaly-git2go/commit/change_file_mode.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/commit.go b/cmd/gitaly-git2go/commit/commit.go index be2d9a585..4a76987d2 100644 --- a/cmd/gitaly-git2go/commit/commit.go +++ b/cmd/gitaly-git2go/commit/commit.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/create_directory.go b/cmd/gitaly-git2go/commit/create_directory.go index b6e959831..226db4eaa 100644 --- a/cmd/gitaly-git2go/commit/create_directory.go +++ b/cmd/gitaly-git2go/commit/create_directory.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/create_file.go b/cmd/gitaly-git2go/commit/create_file.go index fe772a431..5fac3a01a 100644 --- a/cmd/gitaly-git2go/commit/create_file.go +++ b/cmd/gitaly-git2go/commit/create_file.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/delete_file.go b/cmd/gitaly-git2go/commit/delete_file.go index 4b680a0f6..729b27d36 100644 --- a/cmd/gitaly-git2go/commit/delete_file.go +++ b/cmd/gitaly-git2go/commit/delete_file.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/move_file.go b/cmd/gitaly-git2go/commit/move_file.go index dc3da4f75..de2ae3444 100644 --- a/cmd/gitaly-git2go/commit/move_file.go +++ b/cmd/gitaly-git2go/commit/move_file.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/update_file.go b/cmd/gitaly-git2go/commit/update_file.go index 031071e09..0b47d711a 100644 --- a/cmd/gitaly-git2go/commit/update_file.go +++ b/cmd/gitaly-git2go/commit/update_file.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/commit/validate.go b/cmd/gitaly-git2go/commit/validate.go index 4531aeef3..b7a2a9fad 100644 --- a/cmd/gitaly-git2go/commit/validate.go +++ b/cmd/gitaly-git2go/commit/validate.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package commit diff --git a/cmd/gitaly-git2go/conflicts/conflicts.go b/cmd/gitaly-git2go/conflicts/conflicts.go index c5a79f85e..1ca08c885 100644 --- a/cmd/gitaly-git2go/conflicts/conflicts.go +++ b/cmd/gitaly-git2go/conflicts/conflicts.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package conflicts diff --git a/cmd/gitaly-git2go/conflicts/conflicts_test.go b/cmd/gitaly-git2go/conflicts/conflicts_test.go index 8c28eb952..34b28bdf7 100644 --- a/cmd/gitaly-git2go/conflicts/conflicts_test.go +++ b/cmd/gitaly-git2go/conflicts/conflicts_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package conflicts diff --git a/cmd/gitaly-git2go/main.go b/cmd/gitaly-git2go/main.go index c42277ca0..208dd5863 100644 --- a/cmd/gitaly-git2go/main.go +++ b/cmd/gitaly-git2go/main.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/main_test.go b/cmd/gitaly-git2go/main_test.go index 64a37c9e1..75cfb525c 100644 --- a/cmd/gitaly-git2go/main_test.go +++ b/cmd/gitaly-git2go/main_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/merge.go b/cmd/gitaly-git2go/merge.go index 6ad8e2bb3..8d57cb16d 100644 --- a/cmd/gitaly-git2go/merge.go +++ b/cmd/gitaly-git2go/merge.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/merge_test.go b/cmd/gitaly-git2go/merge_test.go index 22c95e9a0..99aca86d4 100644 --- a/cmd/gitaly-git2go/merge_test.go +++ b/cmd/gitaly-git2go/merge_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/rebase.go b/cmd/gitaly-git2go/rebase.go index 2987bbc28..2608aa07c 100644 --- a/cmd/gitaly-git2go/rebase.go +++ b/cmd/gitaly-git2go/rebase.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/rebase_test.go b/cmd/gitaly-git2go/rebase_test.go index 82fce076b..27c15d5e7 100644 --- a/cmd/gitaly-git2go/rebase_test.go +++ b/cmd/gitaly-git2go/rebase_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/resolve_conflicts.go b/cmd/gitaly-git2go/resolve_conflicts.go index 5f64fd6ca..3ba47d413 100644 --- a/cmd/gitaly-git2go/resolve_conflicts.go +++ b/cmd/gitaly-git2go/resolve_conflicts.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/revert.go b/cmd/gitaly-git2go/revert.go index 3e18bb86f..4cea118c7 100644 --- a/cmd/gitaly-git2go/revert.go +++ b/cmd/gitaly-git2go/revert.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/revert_test.go b/cmd/gitaly-git2go/revert_test.go index f1f9976ef..050e086e8 100644 --- a/cmd/gitaly-git2go/revert_test.go +++ b/cmd/gitaly-git2go/revert_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/set_config.go b/cmd/gitaly-git2go/set_config.go index a68c38efc..79b104e6f 100644 --- a/cmd/gitaly-git2go/set_config.go +++ b/cmd/gitaly-git2go/set_config.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/submodule.go b/cmd/gitaly-git2go/submodule.go index 8a152c2fc..963adb24a 100644 --- a/cmd/gitaly-git2go/submodule.go +++ b/cmd/gitaly-git2go/submodule.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/submodule_test.go b/cmd/gitaly-git2go/submodule_test.go index b8675c0c5..7906e3f95 100644 --- a/cmd/gitaly-git2go/submodule_test.go +++ b/cmd/gitaly-git2go/submodule_test.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main diff --git a/cmd/gitaly-git2go/testhelper/testhelper.go b/cmd/gitaly-git2go/testhelper/testhelper.go index 20db57890..6f0824e01 100644 --- a/cmd/gitaly-git2go/testhelper/testhelper.go +++ b/cmd/gitaly-git2go/testhelper/testhelper.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package testhelper diff --git a/cmd/gitaly-git2go/util.go b/cmd/gitaly-git2go/util.go index da3fcd258..0c6360fa3 100644 --- a/cmd/gitaly-git2go/util.go +++ b/cmd/gitaly-git2go/util.go @@ -1,3 +1,4 @@ +//go:build static && system_libgit2 // +build static,system_libgit2 package main |