diff --git a/Tools.mk b/Tools.mk index 894f676..4d16735 100644 --- a/Tools.mk +++ b/Tools.mk @@ -1,6 +1,6 @@ # Copyright 2021 Tetrate # Licensed under the Apache License, Version 2.0 (the "License") -golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1 -goimports := golang.org/x/tools/cmd/goimports@v0.1.7 +golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2 +goimports := golang.org/x/tools/cmd/goimports@v0.1.10 licenser := github.com/liamawhite/licenser@v0.6.0 diff --git a/go.mod b/go.mod index 585782a..f1f0b65 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/tetratelabs/car // This project uses go:embed, so requires minimally go 1.16 -go 1.17 +go 1.18 require ( - github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect - github.com/docker/distribution v2.7.1+incompatible + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/docker/distribution v2.8.1+incompatible github.com/opencontainers/go-digest v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/stretchr/testify v1.7.0 - github.com/urfave/cli/v2 v2.3.0 + github.com/urfave/cli/v2 v2.6.0 ) require ( diff --git a/go.sum b/go.sum index e0bf079..33c1a63 100644 --- a/go.sum +++ b/go.sum @@ -1,26 +1,21 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/cli/v2 v2.6.0 h1:yj2Drkflh8X/zUrkWlWlUjZYHyWN7WMmpVxyxXIUyv8= +github.com/urfave/cli/v2 v2.6.0/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/car/car.go b/internal/car/car.go index 8471a0d..0fa94b4 100644 --- a/internal/car/car.go +++ b/internal/car/car.go @@ -106,7 +106,7 @@ func (c *car) Extract(ctx context.Context, tag, platform, directory string, stri baseDir := path.Dir(destinationPath) if _, ok := dirsCreated[baseDir]; !ok { - if err := os.MkdirAll(baseDir, 0755); err != nil { //nolint:gosec + if err := os.MkdirAll(baseDir, 0o755); err != nil { //nolint:gosec return err } dirsCreated[baseDir] = struct{}{} diff --git a/internal/registry/fake/fake.go b/internal/registry/fake/fake.go index 64f1597..e0853e3 100644 --- a/internal/registry/fake/fake.go +++ b/internal/registry/fake/fake.go @@ -127,16 +127,16 @@ type fakeFile struct { // The fake data intentionally overlaps on "usr/local" for testing. Even if weird, it adds windows paths. var fakeFiles = [][]*fakeFile{ { - {"bin/apple.txt", 10, 0640 & os.ModePerm, "2020-06-07T06:28:15Z"}, - {"usr/local/bin/boat", 20, 0755 & os.ModePerm, "2021-04-16T22:53:09Z"}, + {"bin/apple.txt", 10, 0o640 & os.ModePerm, "2020-06-07T06:28:15Z"}, + {"usr/local/bin/boat", 20, 0o755 & os.ModePerm, "2021-04-16T22:53:09Z"}, }, { - {"usr/local/bin/car", 30, 0755 & os.ModePerm, "2021-05-12T03:53:29Z"}, + {"usr/local/bin/car", 30, 0o755 & os.ModePerm, "2021-05-12T03:53:29Z"}, }, { - {"Files/ProgramData/truck/bin/truck.exe", 40, 0644 & os.ModePerm, "2021-05-12T03:53:15Z"}, + {"Files/ProgramData/truck/bin/truck.exe", 40, 0o644 & os.ModePerm, "2021-05-12T03:53:15Z"}, }, { - {"usr/local/sbin/car", 50, 0755 & os.ModePerm, "2021-05-12T03:53:29Z"}, + {"usr/local/sbin/car", 50, 0o755 & os.ModePerm, "2021-05-12T03:53:29Z"}, }, } diff --git a/internal/registry/registry.go b/internal/registry/registry.go index b3e4d39..5847165 100644 --- a/internal/registry/registry.go +++ b/internal/registry/registry.go @@ -250,7 +250,7 @@ func (r *registry) ReadFilesystemLayer(ctx context.Context, layer *internal.File mode := th.FileInfo().Mode() if mode.Perm() == 0 { // Windows doesn't need the execute bit, this makes `car` usable on darwin and linux. - mode = 0644 & os.ModePerm + mode = 0o644 & os.ModePerm } if err := readFile(th.Name, th.Size, mode, th.ModTime, tr); err != nil { return fmt.Errorf("error calling readFile on %s: %w", th.Name, err)