Skip to content

Commit

Permalink
chore: enable Go linting and vetting + rename CI job (#11)
Browse files Browse the repository at this point in the history
* chore: enable Go linting and vetting + rename job

* chore: use `golangci/golangci-lint-action`

* fix: placate the linter
  • Loading branch information
aschlosberg authored Mar 1, 2024
1 parent a0ae64b commit 363bd8a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ on:

jobs:

build:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
- name: Setup
uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand All @@ -27,3 +27,11 @@ jobs:

- name: Test
run: go test -v ./...

- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54

- name: Vet
run: go vet ./...
6 changes: 5 additions & 1 deletion compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ func (s *spliceConcat) shrink() error {
func (s *spliceConcat) bytes() ([]byte, error) {
code := new(bytes.Buffer)
for _, sp := range s.all {
sp.buf.WriteTo(code)
if _, err := sp.buf.WriteTo(code); err != nil {
// This should be impossible, but ignoring the error angers the
// linter.
return nil, fmt.Errorf("%T.bytes(): %T.buf.WriteTo(%T): %v", s, sp, code, err)
}

switch sp.op.(type) {
case JUMPDEST:
Expand Down

0 comments on commit 363bd8a

Please sign in to comment.