Skip to content

Commit 21c4ea9

Browse files
authored
Merge pull request #8 from bengarrett/v18
Go v18.
2 parents f1a5351 + 262d0d9 commit 21c4ea9

11 files changed

+37
-718
lines changed

.github/workflows/release.yml

+7-12
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,32 @@ on:
44
pull_request:
55
push:
66
tags:
7-
- '*'
7+
- "*"
88

99
jobs:
1010
goreleaser:
1111
runs-on: ubuntu-latest
1212
steps:
13-
-
14-
name: Checkout
13+
- name: Checkout
1514
uses: actions/checkout@v2
1615
with:
1716
fetch-depth: 0
18-
-
19-
name: Set up Go
17+
- name: Set up Go
2018
uses: actions/setup-go@v2
2119
with:
22-
go-version: 1.17
23-
-
24-
name: Cache Go modules
20+
go-version: 1.18
21+
- name: Cache Go modules
2522
uses: actions/cache@v1
2623
with:
2724
path: ~/go/pkg/mod
2825
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
2926
restore-keys: |
3027
${{ runner.os }}-go-
31-
-
32-
name: Tests
28+
- name: Tests
3329
run: |
3430
go mod tidy
3531
go test -v ./...
36-
-
37-
name: Run GoReleaser
32+
- name: Run GoReleaser
3833
uses: goreleaser/goreleaser-action@v2
3934
with:
4035
version: latest

.goreleaser.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -9,61 +9,61 @@ before:
99
- go mod tidy
1010
builds:
1111
- id: FreeBSD
12-
goos: ['freebsd']
13-
goarch: ['amd64']
12+
goos: ["freebsd"]
13+
goarch: ["amd64"]
1414
- id: Linux_Intel
15-
goos: ['linux']
16-
goarch: ['amd64']
15+
goos: ["linux"]
16+
goarch: ["amd64"]
1717
- id: macOS
18-
goos: ['darwin']
19-
goarch: ['amd64', 'arm64']
18+
goos: ["darwin"]
19+
goarch: ["amd64", "arm64"]
2020
- id: Windows
21-
goos: ['windows']
22-
goarch: ['amd64']
21+
goos: ["windows"]
22+
goarch: ["amd64"]
2323
universal_binaries:
2424
- id: macOS
2525
name_template: "{{ .ProjectName }}"
2626
replace: true
2727
archives:
2828
- id: FreeBSD
29-
builds: ['FreeBSD']
29+
builds: ["FreeBSD"]
3030
format: tar.gz
3131
files:
32-
- none*
32+
- none*
3333
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
3434
replacements:
3535
amd64: Intel
3636
freebsd: FreeBSD
3737
- id: Linux_Intel
38-
builds: ['Linux_Intel']
38+
builds: ["Linux_Intel"]
3939
format: tar.gz
4040
files:
41-
- none*
41+
- none*
4242
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
4343
replacements:
44-
amd64: Intel
4544
linux: Linux
4645
- id: macOS
47-
builds: ['macOS']
46+
builds: ["macOS"]
4847
format: tar.gz
4948
files:
50-
- none*
49+
- none*
5150
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
5251
replacements:
5352
darwin: macOS
53+
amd64: Intel
5454
- id: Windows
55-
builds: ['Windows']
55+
builds: ["Windows"]
5656
format: zip
5757
files:
58-
- none*
58+
- none*
5959
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
6060
replacements:
6161
amd64: Intel
6262
windows: Windows
6363

6464
nfpms:
6565
- id: Linux
66-
builds: ['Linux_Intel']
66+
builds: ["Linux_Intel"]
6767
file_name_template: "{{ .ProjectName }}"
6868
replacements:
6969
amd64: Intel
@@ -104,4 +104,4 @@ scoop:
104104

105105
changelog:
106106
skip: false
107-
use: git
107+
use: git

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/bengarrett/zipcmt
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/bengarrett/retrotxtgo v0.0.37
@@ -14,6 +14,6 @@ require (
1414
github.com/dlclark/regexp2 v1.4.0 // indirect
1515
github.com/mitchellh/go-homedir v1.1.0 // indirect
1616
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
17-
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
17+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
1818
golang.org/x/text v0.3.7 // indirect
1919
)

go.sum

+2-676
Large diffs are not rendered by default.

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"text/tabwriter"
1414

1515
"github.com/bengarrett/zipcmt/internal/misc"
16-
zipcmt "github.com/bengarrett/zipcmt/lib"
16+
zipcmt "github.com/bengarrett/zipcmt/pkg"
1717
"github.com/gookit/color"
1818
)
1919

lib/example_posix_test.go pkg/example_posix_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
// © Ben Garrett https://github.com/bengarrett/zipcmt
54

@@ -9,7 +8,7 @@ import (
98
"fmt"
109
"log"
1110

12-
zipcmt "github.com/bengarrett/zipcmt/lib"
11+
zipcmt "github.com/bengarrett/zipcmt/pkg"
1312
)
1413

1514
func ExampleConfig_Clean() {

lib/example_test.go pkg/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"log"
88

9-
zipcmt "github.com/bengarrett/zipcmt/lib"
9+
zipcmt "github.com/bengarrett/zipcmt/pkg"
1010
"github.com/gookit/color"
1111
)
1212

lib/example_win_test.go pkg/example_win_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build windows
2-
// +build windows
32

43
// © Ben Garrett https://github.com/bengarrett/zipcmt
54

@@ -9,7 +8,7 @@ import (
98
"fmt"
109
"log"
1110

12-
zipcmt "github.com/bengarrett/zipcmt/lib"
11+
zipcmt "github.com/bengarrett/zipcmt/pkg"
1312
)
1413

1514
func ExampleConfig_clean() {

lib/log.go pkg/log.go

File renamed without changes.

lib/zipcmt.go pkg/zipcmt.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ func (c *Config) Clean() error {
228228
return nil
229229
}
230230
name = filepath.Clean(name)
231-
p := strings.Split(name, string(filepath.Separator))
232-
if p[0] == "~" {
231+
before, _, _ := strings.Cut(name, string(filepath.Separator))
232+
if before == "~" {
233233
hd, err := os.UserHomeDir()
234234
if err != nil {
235235
return fmt.Errorf("%s: export %w", name, err)

lib/zipcmt_test.go pkg/zipcmt_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88
"testing"
99

10-
zipcmt "github.com/bengarrett/zipcmt/lib"
10+
zipcmt "github.com/bengarrett/zipcmt/pkg"
1111
"github.com/gookit/color"
1212
)
1313

0 commit comments

Comments
 (0)