name: go-presubmit
on:
  push:
    branches: ['master']
  pull_request:
    paths: ['go/**', '.github/workflows/presubmit-go.yml']

defaults:
  run:
    working-directory: go

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: gofmt
        run: test -z "$(gofmt -d . | tee >&2)"
      - name: golint
        run: |
          go get -u golang.org/x/lint/golint
          $(go env GOPATH)/bin/golint -set_exit_status=1 ./...

  unit-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run tests
        run: go test ./...

name: go-presubmit
on:
  push:
    branches: ['master']
  pull_request:
    paths: ['go/**', '.github/workflows/presubmit-go.yml']

defaults:
  run:
    working-directory: go

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: gofmt
        run: test -z "$(gofmt -d . | tee >&2)"
      - name: golint
        run: |
          go install golang.org/x/lint/golint@latest
          $(go env GOPATH)/bin/golint -set_exit_status=1 ./...

  unit-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run tests
        run: go test ./...

Install golint instead of 'get'ting it.
Install golint instead of 'get'ting it.

`go get` appears to be deprecated for installing binaries
(https://go.dev/doc/go-get-install-deprecation).
