apply gofmt and enforce it for new commits
This commit is contained in:
parent
bf7de6b1fb
commit
ba5fcc4ad8
|
@ -85,6 +85,9 @@ jobs:
|
|||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "1.17.5"
|
||||
# ensure that code is formatted
|
||||
- run: GOFMT_OUTPUT="$(gofmt -l `find ./node ./event_database -name '*.go' | grep -v vendor` 2>&1)"; [ -n "$GOFMT_OUTPUT" ] && printf "All the following files are not correctly formatted\n${GOFMT_OUTPUT}\n" && exit 1"
|
||||
# run linters
|
||||
- run: make generate && ./lint.sh
|
||||
# The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols.
|
||||
- run: cd node && go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./...
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
|
||||
func main() {
|
||||
var port int
|
||||
var code int
|
||||
|
@ -19,12 +18,11 @@ func main() {
|
|||
|
||||
flag.Parse()
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request){
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(code)
|
||||
fmt.Fprintf(w, "%s\n", message)
|
||||
})
|
||||
|
||||
|
||||
fmt.Printf("Starting server at port %d\nResponse code (%d)\nmessage (%s)\n", port, code, message)
|
||||
if err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil); err != nil {
|
||||
fmt.Fprintf(os.Stderr, err.Error())
|
||||
|
|
|
@ -1898,4 +1898,3 @@ func (_Abi *AbiFilterer) ParseUpgraded(log types.Log) (*AbiUpgraded, error) {
|
|||
event.Raw = log
|
||||
return event, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue