Skip to content

Instantly share code, notes, and snippets.

@eduardoveiga
Created March 9, 2020 13:12
Show Gist options
  • Select an option

  • Save eduardoveiga/6478b342bc6408389b12fd8485485c49 to your computer and use it in GitHub Desktop.

Select an option

Save eduardoveiga/6478b342bc6408389b12fd8485485c49 to your computer and use it in GitHub Desktop.
#!/bin/sh
for file in `git ls-tree -r master --name-only | grep \\.go`
do
echo $file
output=`gofmt -w "$file"`
if test -n "$output"
then
echo >&2 "$output"
exitcode=1
fi
done
@eduardoveiga
Copy link
Copy Markdown
Author

#!/bin/sh

for file in git ls-tree -r master --name-only | grep \\.go
do
echo $file
output=gofmt -w "$file"

if test -n "$output"
then
	echo >&2 "$output"
	exitcode=1
fi

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment