version: 2

references:
  test-steps: &test-steps
    steps:
      - checkout
      - restore_cache:
          name: Restore module caches
          keys:
            - go-modules-v1-{{ .Branch }}-{{ checksum "go.sum" }}
            - go-modules-v1-{{ .Branch }}-
            - go-modules-v1-
      - run:
          name: Install lint tools
          command: make -s install-tools
      - run:
          name: Check Gofmt diff
          command: make -s fmt-diff
      - run:
          name: Run GolangCI-Lint
          command: make -s ci-lint
      - run:
          name: Run Golint
          command: make -s lint
      - run:
          name: Run Vet
          command: make -s vet
      - run:
          name: Test
          command: make -s test
      - save_cache:
          name: Save module caches
          key: go-modules-v1-{{ .Branch }}-{{ checksum "go.sum" }}
          paths:
            - /go/pkg/mod

jobs:
  test-1.13:
    docker:
      - image: circleci/golang:1.13
    <<: *test-steps

  test-1.14:
    docker:
      - image: circleci/golang:1.14
    <<: *test-steps

workflows:
  version: 2
  test:
    jobs:
      - test-1.13
      - test-1.14

version: 2

references:
  test-steps: &test-steps
    steps:
      - checkout
      - restore_cache:
          name: Restore module caches
          keys:
            - go-modules-v1-{{ .Branch }}-{{ checksum "go.sum" }}
            - go-modules-v1-{{ .Branch }}-
            - go-modules-v1-
      - run:
          name: Install lint tools
          command: make -s install-tools
      - run:
          name: Check Gofmt diff
          command: make -s fmt-diff
      - run:
          name: Run GolangCI-Lint
          command: make -s ci-lint
      - run:
          name: Run Golint
          command: make -s lint
      - run:
          name: Run Vet
          command: make -s vet
      - run:
          name: Test
          command: make -s test
      - save_cache:
          name: Save module caches
          key: go-modules-v1-{{ .Branch }}-{{ checksum "go.sum" }}
          paths:
            - /go/pkg/mod

jobs:
  test-1.14:
    docker:
      - image: circleci/golang:1.14
    <<: *test-steps

  test-1.15:
    docker:
      - image: circleci/golang:1.15
    <<: *test-steps

workflows:
  version: 2
  test:
    jobs:
      - test-1.14
      - test-1.15

Update go version in CircleCI
Update go version in CircleCI
