diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22a68b7..ff35d53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: ^1.16 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 45b729e..d55ca33 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,18 +6,19 @@ on: pull_request: jobs: golangci: - strategy: - matrix: - go-version: [1.16.x] - os: [ubuntu-latest] name: lint - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ^1.16 - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: latest + # Optional: golangci-lint command line arguments. + args: --enable gosec - name: testing run: go test ./... diff --git a/.github/workflows/vulns.yml b/.github/workflows/vulns.yml index 3921b6c..743458d 100644 --- a/.github/workflows/vulns.yml +++ b/.github/workflows/vulns.yml @@ -13,7 +13,9 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ^1.16 + - name: install depm + run: go install github.com/spiegel-im-spiegel/depm@latest - name: WriteGoList - run: go list -json -m all > go.list + run: depm list --json > go.list - name: Nancy uses: sonatype-nexus-community/nancy-github-action@main diff --git a/README.md b/README.md index 33dd5f5..2e3d240 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/spiegel-im-spiegel/ml/master/LICENSE) [![GitHub release](http://img.shields.io/github/release/spiegel-im-spiegel/ml.svg)](https://github.com/spiegel-im-spiegel/ml/releases/latest) +This package is required Go 1.16 or later. + ## Build and Install ``` diff --git a/dependency.png b/dependency.png index 2126785..28fef59 100644 Binary files a/dependency.png and b/dependency.png differ diff --git a/go.mod b/go.mod index 57f5a2b..df30a1e 100644 --- a/go.mod +++ b/go.mod @@ -8,10 +8,8 @@ require ( github.com/mattn/go-encoding v0.0.2 github.com/spf13/cobra v1.1.3 github.com/spiegel-im-spiegel/errs v1.0.2 - github.com/spiegel-im-spiegel/fetch v0.2.2 - github.com/spiegel-im-spiegel/gocli v0.10.3 + github.com/spiegel-im-spiegel/fetch v0.2.3 + github.com/spiegel-im-spiegel/gocli v0.10.4 github.com/zetamatta/go-readline-ny v0.4.3 - golang.org/x/net v0.0.0-20201224014010-6772e930b67b + golang.org/x/net v0.0.0-20210222171744-9060382bd457 ) - -replace github.com/coreos/etcd v3.3.13+incompatible => github.com/coreos/etcd v3.3.25+incompatible diff --git a/go.sum b/go.sum index 6db41c3..08d7ff3 100644 --- a/go.sum +++ b/go.sum @@ -32,7 +32,7 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -173,10 +173,10 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spiegel-im-spiegel/errs v1.0.2 h1:v4amEwRDqRWjKHOILQnJSovYhZ4ZttEnBBXNXEzS6Sc= github.com/spiegel-im-spiegel/errs v1.0.2/go.mod h1:UoasJYYujMcdkbT9USv8dfZWoMyaY3btqQxoLJImw0A= -github.com/spiegel-im-spiegel/fetch v0.2.2 h1:of03ciFaq9arqhvvXeMeotpHa9zn2ogKwFtTHTtDkU8= -github.com/spiegel-im-spiegel/fetch v0.2.2/go.mod h1:IQvb70onwbv58/tGz1QhKYEaZs/2ehPaHMva39/jrrU= -github.com/spiegel-im-spiegel/gocli v0.10.3 h1:+9V71Tl3ELjNEsEcXVSZKxJHaiTC55mVsPQwrZq8AAc= -github.com/spiegel-im-spiegel/gocli v0.10.3/go.mod h1:9vRvly2giutJ2sAtQjrw570p9ulJA3twgKlurmnj12g= +github.com/spiegel-im-spiegel/fetch v0.2.3 h1:Zh5rHvOjfC81rxKvtUD21JT609smds+BRh+H84s8qEw= +github.com/spiegel-im-spiegel/fetch v0.2.3/go.mod h1:ePIXxdC9OvSarXEO6HW1MgQwtBaKQo0qgDLOhKFXkQ0= +github.com/spiegel-im-spiegel/gocli v0.10.4 h1:aoAWdiQ4hjNxmEod4EeTZTcjdCJcrNOwgHBs5BQYnEQ= +github.com/spiegel-im-spiegel/gocli v0.10.4/go.mod h1:ffI3zoggRyLOZ+IIgaVN8WVMUwfIwfvCEd/0Yl/PZ98= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -231,8 +231,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210222171744-9060382bd457 h1:hMm9lBjyNLe/c9C6bElQxp4wsrleaJn1vXMZIQkNN44= +golang.org/x/net v0.0.0-20210222171744-9060382bd457/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/makelink/makelink.go b/makelink/makelink.go index cae5887..5bf6423 100644 --- a/makelink/makelink.go +++ b/makelink/makelink.go @@ -7,7 +7,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "strings" @@ -100,7 +99,7 @@ func (lnk *Link) TitleName() string { //Encode returns string (io.Reader) with other style func (lnk *Link) Encode(t Style) io.Reader { if lnk == nil { - return ioutil.NopCloser(bytes.NewReader(nil)) + return io.NopCloser(bytes.NewReader(nil)) } buf := &bytes.Buffer{} switch t { diff --git a/test-all.sh b/test-all.sh index ab9a17f..9d97f8a 100755 --- a/test-all.sh +++ b/test-all.sh @@ -2,6 +2,6 @@ go mod verify || exit 1 go mod tidy -v || exit 1 depm list --json | docker run --rm -i sonatypecommunity/nancy:latest sleuth -n || exit 1 -docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:latest golangci-lint run --enable gosec ./... || exit 1 +docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 golangci-lint run --enable gosec ./... || exit 1 go test ./... || exit 1 depm m --dot --dot-config dot-config.toml | dot -Tpng -o dependency.png