Can you just check that the vcs diffs them as no diff? e.g. ``` if [ -n "$(git diff -- go.mod go.sum)" ]; then git diff -- go.mod go.sum exit 1 fi ```
On Wed, 2019-03-06 at 11:07 -0800, eborgst...@nerdwallet.com wrote: > Hi fellow Gophers, > > My company has a requirement in our CI builds that no files which are > part > of the repository are modified as part of the build. > > For our Go builds this bites us sometimes because there are > circumstances > where someone can push a commit where when `go build`/`go test` are > called > the go.mod/go.sum files end up being modified. > > It's generally always an easy fix, but what I'm looking for is a way > to > provide early & explicit feedback to our Gophers. > > I've been through all the CLI docs but I can't find anything which > asserts > that go.mod & go.sum are in sync without actually changing them. > > Does anyone have any suggestions here? > > Thanks! > EB > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.