checkspaces checks if there is a space between // and directives.
go get github.com/masibw/checkspaces/cmd/checkspaces
go install github.com/masibw/checkspaces/cmd/[email protected]
go vet -vettool=`which checkspaces` ./...
var ( // go:embed testfile.txt fileInvalid byte )
./main.go:9:2: There is a space between slash and the directive: go:embed
You can add any directives that you want to check whether if there is a space between // and directives. You can place config file as
directive: - any - something:else
checkspaces searches for checkspaces.yml in directories up to the root from the file directory which analyzing currently. (not the working directory(command executed))
You can use the -checkspaces.configPath flag at runtime to indicate config by an absolute path.