Skip to content

Commit

Permalink
Update Go dependencies (#102)
Browse files Browse the repository at this point in the history
* Update all Go modules to the latest versions.
* Update Go minimum version to 1.17.
* Update Go modules file format to 1.17.
* Fixup `go fmt ./...`.
* Fixup `gofumpt` warnings.
* Enable dependabot.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ authored May 19, 2022
1 parent c07310f commit f77df0b
Show file tree
Hide file tree
Showing 13 changed files with 387 additions and 44 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
6 changes: 3 additions & 3 deletions cmd/fastly-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"text/tabwriter"
"time"

"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/oklog/run"
"github.com/fastly/fastly-exporter/pkg/api"
"github.com/fastly/fastly-exporter/pkg/filter"
"github.com/fastly/fastly-exporter/pkg/prom"
"github.com/fastly/fastly-exporter/pkg/rt"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/oklog/run"
"github.com/peterbourgon/ff/v3"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sync/errgroup"
Expand Down
4 changes: 2 additions & 2 deletions cmd/fieldgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func exec() error {
}
}

var buf = bytes.NewBuffer(nil)
buf := bytes.NewBuffer(nil)

fmt.Fprintln(buf, "// Code generated by fieldgen; DO NOT EDIT.")
fmt.Fprintln(buf)
Expand Down Expand Up @@ -330,7 +330,7 @@ func writeGoFile(filename string, source []byte) error {
return fmt.Errorf("could not format source: %s", err)
}

if err := ioutil.WriteFile(filename, src, 0644); err != nil {
if err := ioutil.WriteFile(filename, src, 0o644); err != nil {
return fmt.Errorf("could not write source: %s", err)
}

Expand Down
29 changes: 22 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
module github.com/fastly/fastly-exporter

go 1.12
go 1.17

require (
github.com/cespare/xxhash v1.1.0
github.com/go-kit/log v0.1.0
github.com/google/go-cmp v0.5.5
github.com/go-kit/log v0.2.1
github.com/google/go-cmp v0.5.8
github.com/gorilla/mux v1.8.0
github.com/json-iterator/go v1.1.11
github.com/json-iterator/go v1.1.12
github.com/oklog/run v1.1.0
github.com/peterbourgon/ff/v3 v3.0.0
github.com/prometheus/client_golang v1.11.0
github.com/peterbourgon/ff/v3 v3.1.2
github.com/prometheus/client_golang v1.12.2
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
google.golang.org/protobuf v1.26.0 // indirect
)
366 changes: 344 additions & 22 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/api/datacenter_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/fastly/fastly-exporter/pkg/api"
"github.com/google/go-cmp/cmp"
)

func TestDatacenterCache(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/service_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"github.com/cespare/xxhash"
"github.com/fastly/fastly-exporter/pkg/filter"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/fastly/fastly-exporter/pkg/filter"
)

// maxServicePageSize is the maximum amount of results that can be requested
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/service_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/fastly/fastly-exporter/pkg/api"
"github.com/fastly/fastly-exporter/pkg/filter"
"github.com/google/go-cmp/cmp"
)

func TestServiceCache(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/prom/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"strings"
"sync"

"github.com/gorilla/mux"
"github.com/fastly/fastly-exporter/pkg/filter"
"github.com/fastly/fastly-exporter/pkg/gen"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/rt/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"sync/atomic"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/fastly/fastly-exporter/pkg/api"
"github.com/google/go-cmp/cmp"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/rt/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"sort"
"sync"

"github.com/fastly/fastly-exporter/pkg/gen"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/fastly/fastly-exporter/pkg/gen"
)

// ServiceIdentifier is a consumer contract for a subscriber manager.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rt/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"strings"
"testing"

"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/google/go-cmp/cmp"
"github.com/fastly/fastly-exporter/pkg/api"
"github.com/fastly/fastly-exporter/pkg/filter"
"github.com/fastly/fastly-exporter/pkg/prom"
"github.com/fastly/fastly-exporter/pkg/rt"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/google/go-cmp/cmp"
)

func TestManager(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rt/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"strings"
"time"

"github.com/fastly/fastly-exporter/pkg/gen"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
jsoniter "github.com/json-iterator/go"
"github.com/fastly/fastly-exporter/pkg/gen"
)

// HTTPClient is a consumer contract for the subscriber.
Expand Down

0 comments on commit f77df0b

Please sign in to comment.