all: update go directive to 1.18
Done with:
go get go@1.18
go mod tidy
go fix ./...
Using go1.21.3.
While here, use testing.T.Helper directly and delete go19_test.go.
For golang/go#60268.
Change-Id: I924bb6d107180a04d1f879003b169c7f792d8dd4
Reviewed-on: https://go-review.googlesource.com/c/review/+/534198
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/git-codereview/go19_test.go b/git-codereview/go19_test.go
deleted file mode 100644
index 999769d..0000000
--- a/git-codereview/go19_test.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.9
-// +build go1.9
-
-package main
-
-import "testing"
-
-func init() {
- setHelper = (*testing.T).Helper
-}
diff --git a/git-codereview/pending_test.go b/git-codereview/pending_test.go
index d46c1d8..1823439 100644
--- a/git-codereview/pending_test.go
+++ b/git-codereview/pending_test.go
@@ -14,9 +14,6 @@
"testing"
)
-// setHelper calls t.Helper() for Go 1.9+ (see go19_test.go) and does nothing otherwise.
-var setHelper = func(t *testing.T) {}
-
func TestPendingNone(t *testing.T) {
gt := newGitTest(t)
defer gt.done()
@@ -470,12 +467,12 @@
}
func testPending(t *testing.T, want string) {
- setHelper(t)
+ t.Helper()
testPendingArgs(t, nil, want)
}
func testPendingArgs(t *testing.T, args []string, want string) {
- setHelper(t)
+ t.Helper()
// fake auth information to avoid Gerrit error
if !auth.initialized {
auth.initialized = true
diff --git a/go.mod b/go.mod
index e3509ac..5a82dfc 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
module golang.org/x/review
-go 1.13
+go 1.18