Skip to content

Commit

Permalink
add Go 1.20, drop 1.18
Browse files Browse the repository at this point in the history
While here, clean up code to support older versions of Go.
Note that none of these changes should explicitly break Go 1.18.
  • Loading branch information
mvdan committed Mar 27, 2023
1 parent f53b991 commit 66d1a7a
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
fail-fast: false
matrix:
go-version:
- '1.18.x'
- '1.19.x'
- '1.20.x'
os:
- ubuntu-latest
- macos-11
Expand All @@ -32,7 +32,7 @@ jobs:
go test -race ./...
- name: Tidy
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.19.x' # no need to do this everywhere
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' # no need to do this everywhere
run: |
go mod tidy
Expand Down
6 changes: 2 additions & 4 deletions cmd/testscript/testdata/env_var_with_go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ unquote withproxy.txt
testscript -v noproxy.txt
stdout ^BANANA=$
stdout '^GOPATH=\$WORK[/\\]\.gopath'$
[!go1.13] stdout ^GOPROXY=$
[go1.13] stdout ^GOPROXY=https://proxy.golang.org,direct$
stdout ^GOPROXY=https://proxy.golang.org,direct$
! stderr .+

env BANANA=banana
Expand All @@ -26,8 +25,7 @@ env GOPROXY=
testscript -v noproxy.txt
stdout ^BANANA=$
stdout '^GOPATH=\$WORK[/\\]\.gopath'$
[!go1.13] stdout ^GOPROXY=$
[go1.13] stdout ^GOPROXY=https://proxy.golang.org,direct$
stdout ^GOPROXY=https://proxy.golang.org,direct$
! stderr .+

# no GOPROXY, no pass-through, with proxy
Expand Down
3 changes: 0 additions & 3 deletions fmtsort/mapelem.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build go1.12
// +build go1.12

package fmtsort

import "reflect"
Expand Down
24 changes: 0 additions & 24 deletions fmtsort/mapelem_1.11.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/rogpeppe/go-internal

go 1.18
go 1.19
3 changes: 0 additions & 3 deletions goproxytest/testdata/list.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# prior to go 1.12 you cannot list a module without a requirement
[!go1.12] go get fruit.com

go list -m -versions fruit.com
stdout 'v1.0.0 v1.1.0'

Expand Down
3 changes: 0 additions & 3 deletions testscript/exe_go118.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18

package testscript

import (
Expand Down
12 changes: 0 additions & 12 deletions testscript/exe_pre_go1.18.go

This file was deleted.

0 comments on commit 66d1a7a

Please sign in to comment.