Skip to content

Commit

Permalink
Update dependencies and GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Aug 27, 2020
1 parent a16c875 commit a6d6179
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 31 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
go-version: 1.15

- name: Set up env
run: |
Expand All @@ -37,16 +37,16 @@ jobs:
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Setup GolangCI-Lint
run: go get -u github.com/golangci/golangci-lint/cmd/[email protected]
env:
GO111MODULE: on
working-directory: ~
- name: Set up GolangCI-Lint
if: matrix.os == 'ubuntu-latest'
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0

- name: GolangCI-Lint
if: matrix.os == 'ubuntu-latest'
run: golangci-lint run

- name: Vet
if: matrix.os == 'ubuntu-latest'
run: go vet -v ./...

- name: Build
Expand Down
30 changes: 15 additions & 15 deletions client/api/api_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestClient(t *testing.T) {
t.Error(err.Error())
}
data.Close()
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
if string(b) != body {
t.Errorf("expected body %q, got %q", body, string(b))
}
Expand All @@ -133,7 +133,7 @@ func TestClient(t *testing.T) {
t.Error(err.Error())
}
data.Close()
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
if string(b) != body {
t.Errorf("expected body %q, got %q", body, string(b))
}
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestClient(t *testing.T) {
t.Error(err.Error())
}
data.Close()
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
if string(b) != body {
t.Errorf("expected body %q, got %q", body, string(b))
}
Expand All @@ -194,7 +194,7 @@ func TestClient(t *testing.T) {
if want.Headers["User-Agent"][0] != client.UserAgent {
t.Errorf("expected user agent %q, got %q", client.UserAgent, want.Headers["User-Agent"][0])
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Testing 1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Testing 1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -239,7 +239,7 @@ func TestClient(t *testing.T) {
if want.Headers["Two"][0] != "2" {
t.Errorf("expected header Two %q, got %q", "2", want.Headers["Two"][0])
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"One":["1"],"Two":["2"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"One":["1"],"Two":["2"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestClient(t *testing.T) {

t.Run("Accept", func(t *testing.T) {
client := New(ts.URL, nil)
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept":["application/json","application/xml"],"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept":["application/json","application/xml"],"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, []string{"application/json", "application/xml"})
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -311,7 +311,7 @@ func TestClient(t *testing.T) {
if want.Headers[DefaultKeyHeader][0] != client.Key {
t.Errorf("expected header %q %q, got %q", DefaultKeyHeader, client.Key, want.Headers[DefaultKeyHeader][0])
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"],"X-Key":["KeyValue"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"],"X-Key":["KeyValue"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -352,7 +352,7 @@ func TestClient(t *testing.T) {
if want.Headers[client.KeyHeader][0] != client.Key {
t.Errorf("expected header %q %q, got %q", client.KeyHeader, client.Key, want.Headers[client.KeyHeader][0])
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"],"X-Custom-Key":["KeyCustomValue"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"],"X-Custom-Key":["KeyCustomValue"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -396,7 +396,7 @@ func TestClient(t *testing.T) {
if want.Headers["Authorization"][0] != wantHeader {
t.Errorf("expected Authorization header %q, got %q", wantHeader, want.Headers["Authorization"][0])
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"Authorization":["Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"Authorization":["Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -437,7 +437,7 @@ func TestClient(t *testing.T) {
if want.Headers[DefaultKeyHeader][0] != client.Key {
t.Errorf("expected header %q %q, got %q", DefaultKeyHeader, client.Key, want.Headers[DefaultKeyHeader][0])
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"],"X-Key":["KeyValue"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"],"X-Key":["KeyValue"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -477,7 +477,7 @@ func TestClient(t *testing.T) {
if want.URL.Path != path {
t.Errorf("expected url path %q, got %q", path, want.URL.Path)
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -517,7 +517,7 @@ func TestClient(t *testing.T) {
if want.URL.Path != path {
t.Errorf("expected url path %q, got %q", path, want.URL.Path)
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/subpath/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/subpath/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -557,7 +557,7 @@ func TestClient(t *testing.T) {
if want.URL.Path != path {
t.Errorf("expected url path %q, got %q", path, want.URL.Path)
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -598,7 +598,7 @@ func TestClient(t *testing.T) {
if want.URL.Query().Get("limit") != "100" {
t.Errorf("expected url path %q, got %q", "100", want.URL.Query().Get("limit"))
}
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body := `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down Expand Up @@ -638,7 +638,7 @@ func TestClient(t *testing.T) {
if want.Body != body {
t.Errorf("expected url path %q, got %q", body, want.Body)
}
body = `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
body = `{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"Headers":{"Accept-Encoding":["gzip"],"User-Agent":["Go-http-client/1.1"]},"Body":""}`
r, err := client.Request("GET", "/", nil, nil, nil)
if err != nil {
t.Error(err.Error())
Expand Down
22 changes: 12 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
module resenje.org/web

go 1.14
go 1.15

require (
github.com/golang/mock v1.4.3 // indirect
github.com/golang/protobuf v1.4.2
github.com/gorilla/handlers v1.4.2
github.com/google/go-cmp v0.5.2 // indirect
github.com/gorilla/handlers v1.5.0
github.com/kr/text v0.2.0 // indirect
github.com/lucas-clemente/quic-go v0.17.2
github.com/lucas-clemente/quic-go v0.18.0
github.com/marten-seemann/qtls v0.10.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/onsi/ginkgo v1.14.0 // indirect
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/common v0.13.0 // indirect
github.com/stretchr/testify v1.6.1 // indirect
github.com/tdewolff/minify/v2 v2.7.6
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/net v0.0.0-20200625001655-4c5254603344
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
github.com/tdewolff/minify/v2 v2.9.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 // indirect
golang.org/x/text v0.3.3 // indirect
google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 // indirect
google.golang.org/grpc v1.30.0
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect
google.golang.org/grpc v1.31.1
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
Expand Down
Loading

0 comments on commit a6d6179

Please sign in to comment.