Hi Jerome, You can take a look at git hooks https://golang.org/misc/git/pre-commit.
Code: test -z "$(gofmt -s -l $(find . -name '*.go' -type f -print) | tee /dev/stderr)" Thanks and regards, Stephane Jeandeaux. On Mon, Feb 19, 2018 at 6:44 AM Jérôme LAFORGE <jerome.lafo...@gmail.com> wrote: > Hello Gophers, > Has any one of you setted up the validation of format (goimports, go fmt) > into Gitlab CI? > My goal is to reject the commit that doesn't respect the Go's format. > > Thx in adv > BR > > -- > 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. > -- 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.