Update format script for new gofmt
gofmt no longer supports `tabs` and `tabwidth`, but we still require exactly-4-space tabs to preserve the narrow layout on gobyexample.com, so re-implement this functionality with sed.
This commit is contained in:
committed by
Mark McGranaghan
parent
a2fe5f2db4
commit
8e7a6bb086
10
tools/format
Executable file
10
tools/format
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
paths=$(ls tools/*.go examples/*/*.go)
|
||||
|
||||
for path in $paths; do
|
||||
gofmt -w=true $path
|
||||
sed -i '' -e 's/ / /g' $path
|
||||
done
|
||||
Reference in New Issue
Block a user