Skip to content

Commit 86f73c5

Browse files
mvdanrogpeppe
andcommitted
testscript: add support for Go master aka 1.18
Fuzzing support brought a new parameter to MainStart, as well as more methods on testDeps. Use build tags to support those without breaking 1.16 nor 1.17. While at it, bump CI to test the two latest Go versions, and run 1.17's gofmt, as CI demands it. Finally, make CI also test with Go's master version, to ensure that we are compatible with it. We pin a specific commit, since that keeps CI stable. Fixes #144. Co-authored-by: Roger Peppe <[email protected]>
1 parent 9df06c3 commit 86f73c5

File tree

26 files changed

+115
-9
lines changed

26 files changed

+115
-9
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
go-version: [1.15.x, 1.16.x]
14+
go-version: [1.16.x, 1.17.x]
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
runs-on: ${{ matrix.os }}
1717
steps:
@@ -34,3 +34,30 @@ jobs:
3434
3535
test -z "$(gofmt -d .)" || (gofmt -d . && false)
3636
test -z "$(git status --porcelain)" || (git status; git diff && false)
37+
38+
test-gotip:
39+
runs-on: ubuntu-latest
40+
continue-on-error: true # master breaks sometimes
41+
steps:
42+
- name: Install Go
43+
env:
44+
GO_COMMIT: d0dd26a88c019d54f22463daae81e785f5867565 # 2021-09-23
45+
run: |
46+
cd $HOME
47+
mkdir $HOME/gotip
48+
cd $HOME/gotip
49+
50+
wget -O gotip.tar.gz https://go.googlesource.com/go/+archive/${GO_COMMIT}.tar.gz
51+
tar -xf gotip.tar.gz
52+
echo "devel go1.18-${GO_COMMIT}" >VERSION
53+
54+
cd src
55+
./make.bash
56+
echo "GOROOT=$HOME/gotip" >>$GITHUB_ENV
57+
echo "$HOME/gotip/bin" >>$GITHUB_PATH
58+
- name: Checkout code
59+
uses: actions/checkout@v2
60+
- name: Test
61+
run: |
62+
go version
63+
go test ./...

cache/default_unix_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !windows && !darwin && !plan9
56
// +build !windows,!darwin,!plan9
67

78
package cache

fmtsort/mapelem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build go1.12
12
// +build go1.12
23

34
package fmtsort

fmtsort/mapelem_1.11.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !go1.12
12
// +build !go1.12
23

34
package fmtsort

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/rogpeppe/go-internal
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e

imports/testdata/import1/x1.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// +build blahblh
2-
// +build linux
3-
// +build !linux
4-
// +build windows
5-
// +build darwin
1+
//go:build blahblh && linux && !linux && windows && darwin
2+
// +build blahblh,linux,!linux,windows,darwin
63

74
package x
85

internal/os/execpath/lp_js.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build js && wasm
56
// +build js,wasm
67

78
package execpath

internal/os/execpath/lp_unix.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build aix || darwin || dragonfly || freebsd || linux || nacl || netbsd || openbsd || solaris
56
// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
67

78
package execpath

internal/syscall/windows/registry/key.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build windows
56
// +build windows
67

78
// Package registry provides access to the Windows registry.

internal/syscall/windows/registry/syscall.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build windows
56
// +build windows
67

78
package registry

0 commit comments

Comments
 (0)