Skip to content

Commit

Permalink
Require Go 1.21 or later (#93)
Browse files Browse the repository at this point in the history
**:warning: Breaking!** The new minimum required Go version is 1.21.
  • Loading branch information
sethvargo committed Dec 18, 2023
1 parent d1721d7 commit b632c02
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: 'ubuntu-latest'

steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'

- uses: 'actions/setup-go@v3'
- uses: 'actions/setup-go@v4'
with:
go-version: '1.17'
go-version: '1.21'

- run: 'make test'
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ arbitrary lookup functions. It supports pre-setting mutations, which is useful
for things like converting values to uppercase, trimming whitespace, or looking
up secrets.

**Note:** Versions prior to v0.2 used a different import path. This README and
examples are for v0.2+.

## Usage

Define a struct with fields using the `env` tag:
Expand Down
8 changes: 4 additions & 4 deletions envconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ type options struct {

// Process processes the struct using the environment. See [ProcessWith] for a
// more customizable version.
func Process(ctx context.Context, i interface{}) error {
func Process(ctx context.Context, i any) error {
return ProcessWith(ctx, i, OsLookuper())
}

// ProcessWith processes the given interface with the given lookuper. See the
// package-level documentation for specific examples and behaviors.
func ProcessWith(ctx context.Context, i interface{}, l Lookuper, fns ...MutatorFunc) error {
func ProcessWith(ctx context.Context, i any, l Lookuper, fns ...MutatorFunc) error {
return processWith(ctx, i, l, false, fns...)
}

Expand All @@ -295,13 +295,13 @@ func ProcessWith(ctx context.Context, i interface{}, l Lookuper, fns ...MutatorF
//
// This is effectively the same as calling [ProcessWith] with an empty
// [MapLookuper].
func ExtractDefaults(ctx context.Context, i interface{}, fns ...MutatorFunc) error {
func ExtractDefaults(ctx context.Context, i any, fns ...MutatorFunc) error {
return processWith(ctx, i, MapLookuper(nil), false, fns...)
}

// processWith is a helper that captures whether the parent wanted
// initialization.
func processWith(ctx context.Context, i interface{}, l Lookuper, parentNoInit bool, fns ...MutatorFunc) error {
func processWith(ctx context.Context, i any, l Lookuper, parentNoInit bool, fns ...MutatorFunc) error {
if l == nil {
return ErrLookuperNil
}
Expand Down
8 changes: 4 additions & 4 deletions envconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ func TestProcessWith(t *testing.T) {

cases := []struct {
name string
input interface{}
exp interface{}
input any
exp any
lookuper Lookuper
mutators []MutatorFunc
err error
Expand Down Expand Up @@ -2666,8 +2666,8 @@ func TestExtractDefaults(t *testing.T) {

cases := []struct {
name string
input interface{}
exp interface{}
input any
exp any
err error
errMsg string
}{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/sethvargo/go-envconfig

go 1.21

require github.com/google/go-cmp v0.5.8
require github.com/google/go-cmp v0.6.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=

0 comments on commit b632c02

Please sign in to comment.