diff options
author | Toon Claes <toon@gitlab.com> | 2021-09-20 19:10:39 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2021-09-20 19:10:39 +0300 |
commit | 5b7382e0251176923f258aa8f8c23a8084f6cae9 (patch) | |
tree | 926cbabc7f5448d4521915424b8dac7ab4979951 /cmd | |
parent | 4b403d5d9bf9151b9cec4852b7bdff02202892f3 (diff) | |
parent | bb18ad9cb4e00d69207f856263c65b46aea37046 (diff) |
Merge branch 'pks-go-drop-1.15-support' into 'master'
Drop support for Go 1.15
See merge request gitlab-org/gitaly!3879
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gitaly-backup/create_test.go | 4 | ||||
-rw-r--r-- | cmd/gitaly-backup/restore_test.go | 4 | ||||
-rw-r--r-- | cmd/gitaly-blackbox/main.go | 3 | ||||
-rw-r--r-- | cmd/gitaly-git2go/apply.go | 3 | ||||
-rw-r--r-- | cmd/gitaly-hooks/hooks_test.go | 3 | ||||
-rw-r--r-- | cmd/gitaly-wrapper/main.go | 3 | ||||
-rw-r--r-- | cmd/gitaly-wrapper/main_test.go | 3 |
7 files changed, 9 insertions, 14 deletions
diff --git a/cmd/gitaly-backup/create_test.go b/cmd/gitaly-backup/create_test.go index 68e8dc2bd..bb58c435f 100644 --- a/cmd/gitaly-backup/create_test.go +++ b/cmd/gitaly-backup/create_test.go @@ -6,7 +6,7 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" + "io" "path/filepath" "testing" @@ -59,7 +59,7 @@ func TestCreateSubcommand(t *testing.T) { require.NoError(t, fs.Parse([]string{"-path", path})) require.EqualError(t, - cmd.Run(context.Background(), &stdin, ioutil.Discard), + cmd.Run(context.Background(), &stdin, io.Discard), "create: pipeline: 1 failures encountered") for _, repo := range repos { diff --git a/cmd/gitaly-backup/restore_test.go b/cmd/gitaly-backup/restore_test.go index d5b7be2c3..a5a5e33c4 100644 --- a/cmd/gitaly-backup/restore_test.go +++ b/cmd/gitaly-backup/restore_test.go @@ -6,7 +6,7 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" + "io" "path/filepath" "testing" @@ -66,7 +66,7 @@ func TestRestoreSubcommand(t *testing.T) { require.NoError(t, fs.Parse([]string{"-path", path})) require.EqualError(t, - cmd.Run(context.Background(), &stdin, ioutil.Discard), + cmd.Run(context.Background(), &stdin, io.Discard), "restore: pipeline: 1 failures encountered") for _, repo := range repos { diff --git a/cmd/gitaly-blackbox/main.go b/cmd/gitaly-blackbox/main.go index cd5cc0647..c0d2481ec 100644 --- a/cmd/gitaly-blackbox/main.go +++ b/cmd/gitaly-blackbox/main.go @@ -3,7 +3,6 @@ package main import ( "flag" "fmt" - "io/ioutil" "os" "github.com/prometheus/client_golang/prometheus" @@ -42,7 +41,7 @@ func main() { } func run(configPath string) error { - configRaw, err := ioutil.ReadFile(configPath) + configRaw, err := os.ReadFile(configPath) if err != nil { return err } diff --git a/cmd/gitaly-git2go/apply.go b/cmd/gitaly-git2go/apply.go index d3bcfc597..4c6691218 100644 --- a/cmd/gitaly-git2go/apply.go +++ b/cmd/gitaly-git2go/apply.go @@ -11,7 +11,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -194,7 +193,7 @@ func (cmd *applySubcommand) threeWayMerge( } func (cmd *applySubcommand) buildFakeAncestor(ctx context.Context, repo *git.Repository, diff []byte) (*git.Tree, error) { - dir, err := ioutil.TempDir("", "gitaly-git2go") + dir, err := os.MkdirTemp("", "gitaly-git2go") if err != nil { return nil, fmt.Errorf("create temporary directory: %w", err) } diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go index c71daf429..93d980bdd 100644 --- a/cmd/gitaly-hooks/hooks_test.go +++ b/cmd/gitaly-hooks/hooks_test.go @@ -5,7 +5,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "os" "os/exec" "path" @@ -786,7 +785,7 @@ func writeTemporaryGitalyConfigFile(t testing.TB, tempDir, gitlabURL, user, pass password = %q `, gitlabURL, secretFile, user, password) - require.NoError(t, ioutil.WriteFile(path, []byte(contents), 0o644)) + require.NoError(t, os.WriteFile(path, []byte(contents), 0o644)) return path, func() { require.NoError(t, os.RemoveAll(path)) } diff --git a/cmd/gitaly-wrapper/main.go b/cmd/gitaly-wrapper/main.go index 3ac422070..3fc315b3c 100644 --- a/cmd/gitaly-wrapper/main.go +++ b/cmd/gitaly-wrapper/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "io/ioutil" "os" "os/exec" "os/signal" @@ -144,7 +143,7 @@ func forwardSignals(gitaly *os.Process, log *logrus.Entry) { } func getPid() (int, error) { - data, err := ioutil.ReadFile(pidFile()) + data, err := os.ReadFile(pidFile()) if err != nil { return 0, err } diff --git a/cmd/gitaly-wrapper/main_test.go b/cmd/gitaly-wrapper/main_test.go index 50ca5a1bc..8014037bb 100644 --- a/cmd/gitaly-wrapper/main_test.go +++ b/cmd/gitaly-wrapper/main_test.go @@ -2,7 +2,6 @@ package main import ( "errors" - "io/ioutil" "os" "os/exec" "strconv" @@ -19,7 +18,7 @@ func TestStolenPid(t *testing.T) { require.NoError(t, os.Setenv(bootstrap.EnvPidFile, oldValue)) }(os.Getenv(bootstrap.EnvPidFile)) - pidFile, err := ioutil.TempFile("", "pidfile") + pidFile, err := os.CreateTemp("", "pidfile") require.NoError(t, err) defer func() { require.NoError(t, os.Remove(pidFile.Name())) }() |