.github: update CI for more recent Go versions

This commit is contained in:
Kevin Burke
2025-02-20 00:02:43 -08:00
parent 1d09c0b505
commit 200a8b4c54
3 changed files with 9 additions and 13 deletions

View File

@@ -7,13 +7,13 @@ jobs:
- name: Install Go
uses: WillAbides/setup-go-faster@main
with:
go-version: 1.21.x
go-version: 1.24.x
- uses: actions/checkout@v4
with:
path: './src/github.com/kevinburke/ssh_config'
# staticcheck needs this for GOPATH
- run: |
echo "GO111MODULE=off" >> $GITHUB_ENV
echo "GO111MODULE=on" >> $GITHUB_ENV
echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV
- name: Run tests
@@ -23,7 +23,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x]
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x, 1.24.x]
runs-on: ubuntu-latest
steps:
- name: Install Go

View File

@@ -1,13 +1,9 @@
BUMP_VERSION := $(GOPATH)/bin/bump_version
STATICCHECK := $(GOPATH)/bin/staticcheck
WRITE_MAILMAP := $(GOPATH)/bin/write_mailmap
$(STATICCHECK):
go get honnef.co/go/tools/cmd/staticcheck
lint: $(STATICCHECK)
lint:
go vet ./...
$(STATICCHECK)
go run honnef.co/go/tools/cmd/staticcheck@latest ./...
test:
@# the timeout helps guard against infinite recursion

View File

@@ -21,9 +21,9 @@ type sshParser struct {
type sshParserStateFn func() sshParserStateFn
// Formats and panics an error message based on a token
func (p *sshParser) raiseErrorf(tok *token, msg string, args ...interface{}) {
func (p *sshParser) raiseErrorf(tok *token, msg string) {
// TODO this format is ugly
panic(tok.Position.String() + ": " + fmt.Sprintf(msg, args...))
panic(tok.Position.String() + ": " + msg)
}
func (p *sshParser) raiseError(tok *token, err error) {
@@ -118,7 +118,7 @@ func (p *sshParser) parseKV() sshParserStateFn {
}
pat, err := NewPattern(strPatterns[i])
if err != nil {
p.raiseErrorf(val, "Invalid host pattern: %v", err)
p.raiseErrorf(val, fmt.Sprintf("Invalid host pattern: %v", err))
return nil
}
patterns = append(patterns, pat)
@@ -144,7 +144,7 @@ func (p *sshParser) parseKV() sshParserStateFn {
return nil
}
if err != nil {
p.raiseErrorf(val, "Error parsing Include directive: %v", err)
p.raiseErrorf(val, fmt.Sprintf("Error parsing Include directive: %v", err))
return nil
}
lastHost.Nodes = append(lastHost.Nodes, inc)