1
Fork 0
main
Motiejus Jakštys 2021-06-01 09:00:27 +03:00
parent 86b7c30680
commit 3d6f45f81c
5 changed files with 14 additions and 7 deletions

View File

@ -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

View File

@ -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
View File

@ -1,3 +1,5 @@
module git.sr.ht/~motiejus/undocker
go 1.16
require honnef.co/go/tools v0.2.0 // indirect

View File

@ -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)

View File

@ -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"`