Skip to content

Commit d368d23

Browse files
authored
chore: bump Go version to 1.19 (#15)
1 parent 4300bac commit d368d23

File tree

8 files changed

+39
-39
lines changed

8 files changed

+39
-39
lines changed

Diff for: .github/workflows/go.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,29 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
1316
- name: Set up Go
14-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v3
1518
with:
16-
go-version: 1.18
17-
18-
- name: Checkout code
19-
uses: actions/checkout@v2
19+
go-version-file: go.mod
2020

2121
- name: Run tests
2222
run: go test -race -coverprofile=coverage.out ./...
2323

2424
- name: Upload coverage
25-
uses: codecov/codecov-action@v2
26-
continue-on-error: true
25+
uses: codecov/codecov-action@v3
2726
with:
2827
files: ./coverage.out
2928

3029
lint:
3130
runs-on: ubuntu-latest
3231
steps:
3332
- name: Checkout code
34-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
3534

3635
- name: Run linters
37-
uses: golangci/golangci-lint-action@v2
36+
uses: golangci/golangci-lint-action@v3
3837
with:
39-
version: v1.45.2
38+
version: v1.49.0

Diff for: .github/workflows/release.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ jobs:
88
release:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Set up Go
12-
uses: actions/setup-go@v2
13-
with:
14-
go-version: 1.18
15-
1611
- name: Checkout code
17-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1813
with:
1914
fetch-depth: 0
2015

16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version-file: go.mod
20+
2121
- name: Run GoReleaser
22-
uses: goreleaser/goreleaser-action@v2
22+
uses: goreleaser/goreleaser-action@v3
2323
with:
2424
version: latest
2525
args: release --rm-dist

Diff for: .golangci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ linters:
22
disable-all: true
33
enable:
44
# enabled by default:
5-
- deadcode
65
- errcheck
76
- gosimple
87
- govet
98
- ineffassign
109
- staticcheck
11-
- structcheck
1210
- typecheck
1311
- unused
14-
- varcheck
1512
# disabled by default:
16-
# - gocritic TODO(junk1tm): enable when github.com/go-critic/go-critic/issues/1193 is closed
13+
- gocritic
1714
- gofumpt
1815

1916
linters-settings:

Diff for: .goreleaser.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
builds:
22
- skip: true
33

4-
release:
5-
draft: true
6-
74
changelog:
85
sort: asc

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A lightweight package for loading environment variables into structs
77
[![awesome](https://awesome.re/badge.svg)](https://github.com/avelino/awesome-go#configuration)
88
[![ci](https://github.com/junk1tm/env/actions/workflows/go.yml/badge.svg)](https://github.com/junk1tm/env/actions/workflows/go.yml)
99
[![docs](https://pkg.go.dev/badge/github.com/junk1tm/env.svg)](https://pkg.go.dev/github.com/junk1tm/env)
10-
[![report](https://goreportcard.com/badge/github.com/junk1tm/env)](https://goreportcard.com/badge/github.com/junk1tm/env)
10+
[![report](https://goreportcard.com/badge/github.com/junk1tm/env)](https://goreportcard.com/report/github.com/junk1tm/env)
1111
[![codecov](https://codecov.io/gh/junk1tm/env/branch/main/graph/badge.svg)](https://codecov.io/gh/junk1tm/env)
1212

1313
</div>

Diff for: env.go

+19-13
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ func (e *NotSetError) Error() string {
5454
// ErrEmptyTagName.
5555
//
5656
// The following types are supported as struct fields:
57-
// int (any kind)
58-
// float (any kind)
59-
// bool
60-
// string
61-
// time.Duration
62-
// encoding.TextUnmarshaler
63-
// slices of any type above (space is the default separator for values)
57+
//
58+
// int (any kind)
59+
// float (any kind)
60+
// bool
61+
// string
62+
// time.Duration
63+
// encoding.TextUnmarshaler
64+
// slices of any type above (space is the default separator for values)
65+
//
6466
// See the strconv package from the standard library for parsing rules.
6567
// Implementing the encoding.TextUnmarshaler interface is enough to use any
6668
// user-defined type. Default values can be specified either using the `default`
@@ -72,18 +74,22 @@ func (e *NotSetError) Error() string {
7274
// The name of the environment variable can be followed by comma-separated
7375
// options in the form of `env:"VAR,option1,option2,..."`. The following
7476
// tag-level options are supported:
75-
// required: mark the environment variable as required
76-
// expand: expand the value of the environment variable using os.Expand
77+
//
78+
// required: mark the environment variable as required
79+
// expand: expand the value of the environment variable using os.Expand
80+
//
7781
// If environment variables are marked as required but not set, an error of type
7882
// NotSetError will be returned. If the tag contains an invalid option, the
7983
// error will be ErrInvalidTagOption.
8084
//
8185
// In addition to the tag-level options, Load also supports the following
8286
// function-level options:
83-
// WithPrefix: set prefix for each environment variable
84-
// WithSliceSeparator: set custom separator to parse slice values
85-
// WithStrictMode: enable strict mode: no `default` tag == required
86-
// WithUsageOnError: enable a usage message printing when an error occurs
87+
//
88+
// WithPrefix: set prefix for each environment variable
89+
// WithSliceSeparator: set custom separator to parse slice values
90+
// WithStrictMode: enable strict mode: no `default` tag == required
91+
// WithUsageOnError: enable a usage message printing when an error occurs
92+
//
8793
// See their documentation for details.
8894
func Load(dst any, opts ...Option) error {
8995
return newLoader(OS, opts...).loadVars(dst)

Diff for: example_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func ExampleWithSliceSeparator() {
124124
fmt.Println(cfg.Ports[2]) // 8082
125125
}
126126

127+
//nolint:gocritic
127128
func ExampleWithStrictMode() {
128129
// os.Setenv("HOST", "localhost")
129130

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/junk1tm/env
22

3-
go 1.18
3+
go 1.19

0 commit comments

Comments
 (0)