Skip to content

Commit 7db96eb

Browse files
Merge pull request #9 from spiegel-im-spiegel/fix-bugs
Bump up Go version 1.16
2 parents 27b0276 + 5bfe416 commit 7db96eb

File tree

7 files changed

+24
-25
lines changed

7 files changed

+24
-25
lines changed

.github/workflows/lint.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
name: lint
22
on:
33
push:
4-
tags:
5-
- v*
64
branches:
75
- master
86
pull_request:
97
jobs:
108
golangci:
11-
strategy:
12-
matrix:
13-
go-version: [1.15.x]
14-
os: [ubuntu-latest]
159
name: lint
16-
runs-on: ${{ matrix.os }}
10+
runs-on: ubuntu-latest
1711
steps:
1812
- uses: actions/checkout@v2
13+
- uses: actions/setup-go@v2
14+
with:
15+
go-version: ^1.16
1916
- name: golangci-lint
2017
uses: golangci/golangci-lint-action@v2
2118
with:
2219
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
2320
version: latest
21+
# Optional: golangci-lint command line arguments.
22+
args: --enable gosec
2423
- name: testing
2524
run: go test ./...

.github/workflows/vulns.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: vulns
22
on:
33
push:
4-
tags:
5-
- v*
64
branches:
75
- master
86
pull_request:
@@ -14,8 +12,10 @@ jobs:
1412
- uses: actions/checkout@v2
1513
- uses: actions/setup-go@v2
1614
with:
17-
go-version: ^1.13
15+
go-version: ^1.16
16+
- name: install depm
17+
run: go install github.com/spiegel-im-spiegel/depm@latest
1818
- name: WriteGoList
19-
run: go list -json -m all > go.list
19+
run: depm list --json > go.list
2020
- name: Nancy
2121
uses: sonatype-nexus-community/nancy-github-action@main

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/spiegel-im-spiegel/openbd-api/master/LICENSE)
66
[![GitHub release](https://img.shields.io/github/release/spiegel-im-spiegel/openbd-api.svg)](https://github.com/spiegel-im-spiegel/openbd-api/releases/latest)
77

8+
This package is required Go 1.16 or later.
9+
810
## Usage of package
911

1012
### Import Package

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package openbd
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"net/http"
88
"net/url"
99
"strings"
@@ -65,7 +65,7 @@ func (c *Client) get(u *url.URL) ([]byte, error) {
6565
if !(resp.StatusCode != 0 && resp.StatusCode < http.StatusBadRequest) {
6666
return nil, errs.Wrap(ErrHTTPStatus, errs.WithContext("url", u.String()), errs.WithContext("status", resp.Status))
6767
}
68-
body, err := ioutil.ReadAll(resp.Body)
68+
body, err := io.ReadAll(resp.Body)
6969
if err != nil {
7070
return body, errs.Wrap(err, errs.WithContext("url", u.String()))
7171
}

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ module github.com/spiegel-im-spiegel/openbd-api
33
go 1.15
44

55
require (
6-
github.com/spf13/cobra v1.0.1-0.20201001152800-40d34bca1bff
6+
github.com/spf13/cobra v1.1.3
77
github.com/spiegel-im-spiegel/errs v1.0.2
8-
github.com/spiegel-im-spiegel/gocli v0.10.3
8+
github.com/spiegel-im-spiegel/gocli v0.10.4
99
)
10-
11-
replace github.com/coreos/etcd v3.3.13+incompatible => github.com/coreos/etcd v3.3.25+incompatible

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm
2626
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
2727
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
2828
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
29-
github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
29+
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
3030
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
3131
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
3232
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
@@ -147,17 +147,17 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k
147147
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
148148
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
149149
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
150-
github.com/spf13/cobra v1.0.1-0.20201001152800-40d34bca1bff h1:lXHkF95Duj/nGE2mY+kNS5DJX5OJ04jO7WA6zCqrp/0=
151-
github.com/spf13/cobra v1.0.1-0.20201001152800-40d34bca1bff/go.mod h1:yk5b0mALVusDL5fMM6Rd1wgnoO5jUPhwsQ6LQAJTidQ=
150+
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
151+
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
152152
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
153153
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
154154
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
155155
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
156156
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
157157
github.com/spiegel-im-spiegel/errs v1.0.2 h1:v4amEwRDqRWjKHOILQnJSovYhZ4ZttEnBBXNXEzS6Sc=
158158
github.com/spiegel-im-spiegel/errs v1.0.2/go.mod h1:UoasJYYujMcdkbT9USv8dfZWoMyaY3btqQxoLJImw0A=
159-
github.com/spiegel-im-spiegel/gocli v0.10.3 h1:+9V71Tl3ELjNEsEcXVSZKxJHaiTC55mVsPQwrZq8AAc=
160-
github.com/spiegel-im-spiegel/gocli v0.10.3/go.mod h1:9vRvly2giutJ2sAtQjrw570p9ulJA3twgKlurmnj12g=
159+
github.com/spiegel-im-spiegel/gocli v0.10.4 h1:aoAWdiQ4hjNxmEod4EeTZTcjdCJcrNOwgHBs5BQYnEQ=
160+
github.com/spiegel-im-spiegel/gocli v0.10.4/go.mod h1:ffI3zoggRyLOZ+IIgaVN8WVMUwfIwfvCEd/0Yl/PZ98=
161161
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
162162
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
163163
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
@@ -282,7 +282,7 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
282282
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
283283
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
284284
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
285-
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
285+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
286286
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
287287
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
288288
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

test-all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
go mod verify || exit 1
33
go mod tidy -v || exit 1
4-
go list -json -m all | nancy sleuth -n || exit 1
5-
golangci-lint run ./... || exit 1
4+
depm list --json | docker run --rm -i sonatypecommunity/nancy:latest sleuth -n || exit 1
5+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 golangci-lint run --enable gosec ./... || exit 1
66
go test ./...

0 commit comments

Comments
 (0)