Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade go version #100

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ linters:
- durationcheck # checks for two durations multiplied together
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
# - execinquery # checks query string in Query function which reads your Go src files and warning it finds
- exhaustive # checks exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
# - exportloopref # checks for pointers to enclosing loop variables
- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
Expand Down
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module github.com/bzimmer/ma

go 1.23.2
go 1.23.4

require (
github.com/bzimmer/httpwares v0.1.3
github.com/bzimmer/manual v0.1.5
github.com/bzimmer/smugmug v0.7.3
github.com/hashicorp/go-metrics v0.5.3
github.com/hashicorp/go-metrics v0.5.4
github.com/rs/zerolog v1.33.0
github.com/spf13/afero v1.11.0
github.com/spf13/afero v1.12.0
github.com/stretchr/testify v1.8.2
github.com/urfave/cli/v2 v2.27.4
github.com/urfave/cli/v2 v2.27.5
github.com/vitali-fedulov/images4 v1.3.1
golang.org/x/sync v0.8.0
golang.org/x/text v0.18.0
golang.org/x/sync v0.10.0
golang.org/x/text v0.21.0
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/time v0.9.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
88 changes: 71 additions & 17 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestMain(m *testing.M) {
}

func runtime(c *cli.Context) *Runtime {
return c.App.Metadata[RuntimeKey].(*Runtime)
return c.App.Metadata[RuntimeKey].(*Runtime) //nolint:errcheck // cannot happen
}

func copyFile(w io.Writer, filename string) error {
Expand Down
34 changes: 0 additions & 34 deletions requirements.txt

This file was deleted.

7 changes: 6 additions & 1 deletion runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ type Encoder interface {
}

func runtime(c *cli.Context) *Runtime {
return c.App.Metadata[RuntimeKey].(*Runtime)
switch t := c.App.Metadata[RuntimeKey].(type) {
case *Runtime:
return t
default:
panic("incorrect context")
}
}

func albumOrNode(c *cli.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion title_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestTitle(t *testing.T) {
}
after := func(u string) cli.AfterFunc {
return func(c *cli.Context) error {
data := decode(a, c.App.Writer.(io.Reader))
data := decode(a, c.App.Writer.(io.Reader)) //nolint:errcheck // cannot happen
a.Equal(u, data["Title"])
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion urlname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestURLName(t *testing.T) {
}
after := func(u string, valid bool) cli.AfterFunc {
return func(c *cli.Context) error {
data := decode(a, c.App.Writer.(io.Reader))
data := decode(a, c.App.Writer.(io.Reader)) //nolint:errcheck // cannot happen
a.Equal(u, data["UrlName"])
a.Equal(valid, data["Valid"])
return nil
Expand Down
Loading