Skip to content

add golangci-lint and fix linting issues #2

add golangci-lint and fix linting issues

add golangci-lint and fix linting issues #2

Workflow file for this run

on: [push, pull_request]
name: Sanity
env:
GO_VERSION: '1.17.x'
GOLANGCI_LINT_VERSION: 'v1.54.1'
jobs:
build:
name: "Run go sanity tools"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Install golint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
- name: Lint
run: make lint
- name: Fmt
run: make fmt
- name: Vet
run: make vet
test:
name: "Run tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Test
run: make test
# Make sure binaries compile on multiple platforms.
crossbuild:
name: "Build / Crossbuild Binaries"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
env:
GOOS: ${{matrix.goos}}
GOARCH: ${{matrix.goarch}}
run: |
env | grep ^GO
make