on: 
  pull_request:
    branches:
      - master
  push:
    branches:
      - master

name: checks

jobs:
  linter-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Run go fmt
        run: diff -u <(echo -n) <(gofmt -d -s .)

      - name: golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:          
          version: 'latest'
          args: -v

  vet-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v2
        with:
          go-version: '1.17.x'
      - uses: actions/checkout@v2

      - name: Run go vet
        run: go vet ./...