| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Copyright 2021 The Bazel Authors. All rights reserved. |
| 4 |
# Use of this source code is governed by a BSD-style |
| 5 |
# license that can be found in the LICENSE file. |
| 6 |
|
| 7 |
set -eu |
| 8 |
|
| 9 |
# Confirm that go.mod and go.sum are tidy. |
| 10 |
cp go.mod go.mod.orig |
| 11 |
cp go.sum go.sum.orig |
| 12 |
go mod tidy |
| 13 |
# Use -w to ignore differences in OS newlines. |
| 14 |
diff -w go.mod.orig go.mod || { echo "go.mod is not tidy"; exit 1; } |
| 15 |
diff -w go.sum.orig go.sum || { echo "go.sum is not tidy"; exit 1; } |
| 16 |
rm go.mod.orig go.sum.orig |
| 17 |
|
| 18 |
# Run tests |
| 19 |
go test ./... |