fiximports script
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
go_files() {
|
||||
find . -type f -name \*.go -not -name \*_cbor_gen.go | grep -v './extern/filecoin-ffi' | grep -v './extern/test-vectors'
|
||||
}
|
||||
|
||||
go_files | xargs -I '{}' sed -i -e '/import (/ {
|
||||
:1
|
||||
$!N
|
||||
s/\n\n/\'$'\n''/
|
||||
/)/!b1
|
||||
}' '{}'
|
||||
|
||||
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project" '{}'
|
||||
go_files | xargs -I '{}' goimports -w -local "github.com/filecoin-project/lotus" '{}'
|
||||
Reference in New Issue
Block a user