Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down