diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c0103e..e0cc879 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,23 +19,23 @@ jobs: test: strategy: matrix: - go: ["1.18.x", "1.22.x", "1.23.x"] + go: ["1.18.x", "oldstable", "stable"] platform: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go ${{ matrix.go }} - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: ${{ matrix.go }} - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Test run: go test -v ./... lint: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: go mod tidy run: | go mod tidy @@ -43,7 +43,4 @@ jobs: - name: Lint run: | docker run --rm -v ./:/go/src/github.com/moby/term -w /go/src/github.com/moby/term \ - golangci/golangci-lint:v1.62.2 golangci-lint run -v \ - -E gofmt \ - -E misspell \ - -E revive + golangci/golangci-lint:v2.8-alpine golangci-lint run -v diff --git a/.gitignore b/.gitignore index b0747ff..417df5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ # if you want to ignore files created by your editor/tools, consider using a # global .gitignore or .git/info/exclude see https://help.github.com/articles/ignoring-files -.* -!.github -!.gitignore profile.out # support running go modules in vendor mode for local development vendor/ diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..652b021 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,29 @@ +version: "2" + +linters: + enable: + - errorlint + - gosec + - misspell + - revive + - unconvert + - unparam + exclusions: + generated: disable + presets: + - comments + - std-error-handling + settings: + staticcheck: + # Enable all options, with some exceptions. + # For defaults, see https://golangci-lint.run/usage/linters/#staticcheck + checks: + - all + - -QF1008 # Omit embedded fields from selector expression; https://staticcheck.dev/docs/checks/#QF1008 + - -ST1003 # Poorly chosen identifier; https://staticcheck.dev/docs/checks/#ST1003 + +formatters: + enable: + - gofumpt + exclusions: + generated: disable diff --git a/ascii.go b/ascii.go index 55873c0..9075888 100644 --- a/ascii.go +++ b/ascii.go @@ -56,7 +56,7 @@ next: if key == "DEL" { codes = append(codes, 127) } else { - return nil, fmt.Errorf("Unknown character: '%s'", key) + return nil, fmt.Errorf("unknown character: '%s'", key) } } else { codes = append(codes, key[0])