File tree Expand file tree Collapse file tree 5 files changed +14
-23
lines changed Expand file tree Collapse file tree 5 files changed +14
-23
lines changed Original file line number Diff line number Diff line change 2323 - name : Checkout code
2424 uses : actions/checkout@v4
2525 - name : Install Go
26- uses : actions/setup-go@v4
26+ uses : actions/setup-go@v5
2727 with :
2828 go-version : ${{ matrix.go-version }}
2929 cache : false # our tests are quick enough
Original file line number Diff line number Diff line change 11# With no .gomodproxy supporting files, we use the GOPROXY from
22# the environment.
3- # Note that Go 1.21 started quoting with single quotes in "go env",
4- # where older versions used double quotes.
53env GOPROXY=0.1.2.3
64unquote file.txt
75testscript -v file.txt
86
97-- file.txt --
108>go env
11- >[!windows] stdout '^GOPROXY=[''"] 0.1.2.3[''"] $'
9+ >[!windows] stdout '^GOPROXY='' 0.1.2.3'' $'
1210>[windows] stdout '^set GOPROXY=0.1.2.3$'
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/rogpeppe/go-internal
33go 1.21
44
55require (
6- golang.org/x/mod v0.9 .0
7- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
8- golang.org/x/tools v0.1.12
6+ golang.org/x/mod v0.18 .0
7+ golang.org/x/sys v0.21.0
8+ golang.org/x/tools v0.22.0
99)
Original file line number Diff line number Diff line change 1- golang.org/x/mod v0.9 .0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs =
2- golang.org/x/mod v0.9 .0 /go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs =
3- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s =
4- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f /go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg =
5- golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU =
6- golang.org/x/tools v0.1.12 /go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc =
1+ golang.org/x/mod v0.18 .0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0 =
2+ golang.org/x/mod v0.18 .0 /go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c =
3+ golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws =
4+ golang.org/x/sys v0.21.0 /go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA =
5+ golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA =
6+ golang.org/x/tools v0.22.0 /go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c =
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
2121 "path/filepath"
2222 "regexp"
2323 "runtime"
24- "sort "
24+ "slices "
2525 "strings"
2626 "sync/atomic"
2727 "syscall"
@@ -754,15 +754,8 @@ func (ts *TestScript) cmdSuggestions(name string) []string {
754754 return nil
755755 }
756756 // deduplicate candidates
757- // TODO: Use slices.Compact (and maybe slices.Sort) once we can use Go 1.21
758- sort .Strings (candidates )
759- out := candidates [:1 ]
760- for _ , c := range candidates [1 :] {
761- if out [len (out )- 1 ] == c {
762- out = append (out , c )
763- }
764- }
765- return out
757+ slices .Sort (candidates )
758+ return slices .Compact (candidates )
766759}
767760
768761func (ts * TestScript ) applyScriptUpdates () {
You can’t perform that action at this time.
0 commit comments