From d74b93584564161b2de771089ee697f07d8bd5b5 Mon Sep 17 00:00:00 2001 From: poy Date: Wed, 8 May 2019 10:21:24 -0600 Subject: [PATCH] ci: adds check to ensure go modules are up to date --- .travis.yml | 1 + ci/check_go_mod.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 ci/check_go_mod.sh diff --git a/.travis.yml b/.travis.yml index 54f22535..f7a32d9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,5 @@ script: - go install github.com/golang/mock/mockgen - ./ci/check_go_fmt.sh - ./ci/check_go_generate.sh + - ./ci/check_go_mod.sh - go test -v ./... diff --git a/ci/check_go_mod.sh b/ci/check_go_mod.sh new file mode 100755 index 00000000..56e79127 --- /dev/null +++ b/ci/check_go_mod.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# This script is used to ensure that the go.mod file is up to date. + +set -euo pipefail + +go mod tidy + +if [ ! -z "$(git status --porcelain)" ]; then + git status + echo + echo "The go.mod is not up to date." + exit 1 +fi