image: golang:1.16-buster

cache:
  paths:
    - /apt-cache
    - /go/src/github.com
    - /go/src/golang.org
    - /go/src/google.golang.org
    - /go/src/gopkg.in

stages:
  - test
  - build

before_script:
  - go get -u golang.org/x/lint/golint  

lint_code:
  stage: test
  script:
    - make lint
  only:
    - merge_requests
    
build:
  stage: build
  script:
    - make build
  except:
    - merge_requests