lint
This commit is contained in:
parent
86b7c30680
commit
3d6f45f81c
@ -1,11 +1,16 @@
|
||||
image: alpine/edge
|
||||
packages:
|
||||
- go
|
||||
- git
|
||||
- make
|
||||
sources:
|
||||
- https://git.sr.ht/~motiejus/undocker
|
||||
tasks:
|
||||
- setup: |
|
||||
GOPATH=/usr/local go install honnef.co/go/tools/cmd/staticcheck
|
||||
- test: |
|
||||
make -C undocker coverage.html
|
||||
- lint: |
|
||||
make -C undocker lint
|
||||
artifacts:
|
||||
- undocker/coverage.html
|
||||
|
7
Makefile
7
Makefile
@ -5,7 +5,12 @@ undocker: $(GODEPS)
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test -cover ./...
|
||||
go test -race -cover ./...
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
staticcheck -f stylish ./...
|
||||
go vet ./...
|
||||
|
||||
.INTERMEDIATE: coverage.out
|
||||
coverage.out: $(GODEPS)
|
||||
|
2
go.mod
2
go.mod
@ -1,3 +1,5 @@
|
||||
module git.sr.ht/~motiejus/undocker
|
||||
|
||||
go 1.16
|
||||
|
||||
require honnef.co/go/tools v0.2.0 // indirect
|
||||
|
2
main.go
2
main.go
@ -31,7 +31,7 @@ func main() {
|
||||
|
||||
c := &command{flattener: rootfs.Flatten, Stdout: os.Stdout}
|
||||
if err := c.execute(os.Args[1], os.Args[2]); err != nil {
|
||||
fmt.Errorf("Error: %v", err)
|
||||
fmt.Printf("Error: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(0)
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@ -20,10 +19,6 @@ const (
|
||||
_whPrefix = ".wh."
|
||||
)
|
||||
|
||||
var (
|
||||
errBadManifest = errors.New("bad manifest.json")
|
||||
)
|
||||
|
||||
type (
|
||||
dockerManifestJSON []struct {
|
||||
Layers []string `json:"Layers"`
|
||||
|
Loading…
Reference in New Issue
Block a user