Add gofmt CI step (#115)
parent
c0eeb00f17
commit
7c4418392f
|
@ -9,6 +9,27 @@ on:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
gofmt:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2.1.4
|
||||||
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
id: go
|
||||||
|
# Check the codebase has been formatted by `gofmt`.
|
||||||
|
# We run two `gofmt` commands for different purposes:
|
||||||
|
# 1. `gofmt -d .`: to print diffs in the CI log if any.
|
||||||
|
# 2. `gofmt -l`: to test there is a diff in the codebase. This is because
|
||||||
|
# `gofmt` exits with exit status 0 even if there is a diff.
|
||||||
|
# This is recommended in https://github.com/golang/go/issues/24230)
|
||||||
|
- name: Run gofmt
|
||||||
|
run: |
|
||||||
|
gofmt -d .
|
||||||
|
test -z $(gofmt -l .)
|
||||||
|
|
||||||
linux-tests:
|
linux-tests:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ func convertMountArgs(daemonVar string, libVar string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
env := []string{ libVar+"=" }
|
env := []string{libVar + "="}
|
||||||
if daemonVar != "" {
|
if daemonVar != "" {
|
||||||
env = append(env, daemonVar+"="+os.Args[0])
|
env = append(env, daemonVar+"="+os.Args[0])
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ func convertMountArgs(daemonVar string, libVar string,
|
||||||
//
|
//
|
||||||
// OSXFUSE seems to ignore InitResponse.MaxWrite, and uses
|
// OSXFUSE seems to ignore InitResponse.MaxWrite, and uses
|
||||||
// this instead.
|
// this instead.
|
||||||
"-o", "iosize="+strconv.FormatUint(buffer.MaxWriteSize, 10),
|
"-o", "iosize=" + strconv.FormatUint(buffer.MaxWriteSize, 10),
|
||||||
}
|
}
|
||||||
|
|
||||||
return argv, env, nil
|
return argv, env, nil
|
||||||
|
|
Loading…
Reference in New Issue