提交 75c54101 编写于 作者: M Mislav Marohnić

[ci] Use `gofmt` to avoid `go fmt` downloading dependencies

`go fmt` doesn't seem to respect `-mod=vendor`
https://github.com/golang/go/issues/27841

Instead try using `gofmt` which doesn't trigger downloading dependencies
in the first place. However, `gofmt` affects files under `vendor/`, so
we reset that before checking for changes.
上级 99464978
......@@ -33,7 +33,8 @@ trap "exit 1" INT
check_formatting() {
[[ "$(go version)" != *" go1.8."* ]] || return 0
make fmt >/dev/null
gofmt -l -w . >/dev/null
git checkout -- vendor
if ! git diff -U1 --exit-code; then
echo
echo "Some go code was not formatted properly." >&2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册