Skip to content

Commit 9b94bc9

Browse files
authored
Minimal go version updated to go 1.18 (#39)
* Minimal go version updated to go 1.18 * Deps updated * GitHub Actions fixed
1 parent 91546c9 commit 9b94bc9

23 files changed

+47
-47
lines changed

.github/workflows/golang.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
- 'macos-latest'
1919
- 'windows-latest'
2020
go:
21-
- '1.16'
22-
- '1.17'
2321
- '1.18'
22+
- '1.19'
23+
- '1.20'
2424

2525
runs-on: ${{ matrix.os }}
2626

@@ -101,12 +101,12 @@ jobs:
101101

102102
steps:
103103
- name: Checkout
104-
uses: actions/checkout@v2
104+
uses: actions/checkout@v3
105105

106106
- name: Setup Go
107-
uses: actions/setup-go@v2
107+
uses: actions/setup-go@v3
108108
with:
109-
go-version: 1.18
109+
go-version: '1.20'
110110

111111
- name: Get dependencies
112112
run: go mod download

.golangci.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,28 @@ linters:
3838
enable-all: true
3939
# Please keep in order
4040
disable:
41+
- deadcode # The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
42+
- exhaustruct # Unecessary annoying!
4143
- exhaustivestruct # Unecessary annoying!
42-
- goerr113 # Useful but not in this package!
44+
- goerr113 # Useful but not in this package!
4345
- gochecknoglobals # Too paranoic!
4446
- goimports # Latest gci with sections is good enougth
4547
- golint # The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive.
48+
- ifshort # The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner.
4649
- interfacer # The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.
4750
- ireturn # Yes! Some functions retures interfaces.
4851
- maligned # The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
4952
- nlreturn # Personally I hate mandatory blank lines before returns.
53+
- nosnakecase # The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
5054
- paralleltest
55+
- rowserrcheck # rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
5156
- scopelint # The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
57+
- structcheck # structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
58+
- testableexamples # New linetr, project is not adapted for this linter yet.
59+
- varcheck # The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
5260
- varnamelen # Annoying!
5361
- unparam # Panics with GOOS=linux
62+
- wastedassign # wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
5463
- wrapcheck # Not needed!
5564
- wsl # Unecessary annoying!
5665

@@ -63,6 +72,12 @@ issues:
6372
- lll
6473
- wrapcheck
6574

75+
- path: enumerator/
76+
linters:
77+
- gci
78+
- gofumpt
79+
- revive
80+
6681
- text: "Line contains TODO/BUG/FIXME"
6782
linters:
6883
- godox

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Changelog
22

3-
## v2 (wip)
3+
## 2.6.0
44

5-
* `go mod tudy -go 1.16`.
6-
* CI Tests: `go1.16`, `go1.17`, `go1.18`.
5+
* `go mod tudy -go 1.18`.
6+
* CI Tests: `go1.18`, `go1.19`, `go1.20`.
77
* CI Cross-build: cleanup.
88
* `golangci-lint` added & code cleaned.
99
* obsolete `darwin/386` code removed.

enumerator/doc.go

-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ This library has been tested on Linux, Windows and Mac and uses specific OS
1616
services to enumerate USB PID/VID, in particular on MacOSX the use of cgo is
1717
required in order to access the IOKit Framework. This means that the library
1818
cannot be easily cross compiled for GOOS=darwing targets.
19-
2019
*/
2120
package enumerator

enumerator/usb_darwin.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build go1.10 && darwin
8-
// +build go1.10,darwin
98

109
package enumerator
1110

enumerator/usb_ole_windows.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build ignore
8-
// +build ignore
98

109
package enumerator
1110

@@ -93,11 +92,11 @@ func getPortDetails(item *ole.IDispatch, res *PortDetails) error {
9392
}
9493
res.Name = re[0][1]
9594

96-
//itemPnPDeviceID, err := item.GetProperty("PnPDeviceID")
97-
//if err != nil {
95+
// itemPnPDeviceID, err := item.GetProperty("PnPDeviceID")
96+
// if err != nil {
9897
// return err
99-
//}
100-
//PnPDeviceID := itemPnPDeviceID.ToString()
98+
// }
99+
// PnPDeviceID := itemPnPDeviceID.ToString()
101100

102101
itemDeviceID, err := item.GetProperty("DeviceID")
103102
if err != nil {

go.mod

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
module github.com/albenik/go-serial/v2
22

3-
go 1.16
3+
go 1.18
44

55
require (
66
github.com/creack/goselect v0.1.2
7-
github.com/kr/text v0.2.0 // indirect
87
github.com/stretchr/testify v1.7.1
9-
go.uber.org/atomic v1.9.0 // indirect
10-
go.uber.org/multierr v1.8.0
11-
golang.org/x/sys v0.0.0-20220327210214-530d0810a4d0
8+
go.uber.org/multierr v1.9.0
9+
golang.org/x/sys v0.5.0
10+
)
11+
12+
require (
13+
github.com/davecgh/go-spew v1.1.1 // indirect
14+
github.com/kr/text v0.2.0 // indirect
15+
github.com/pmezard/go-difflib v1.0.0 // indirect
16+
go.uber.org/atomic v1.10.0 // indirect
1217
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
18+
gopkg.in/yaml.v3 v3.0.1 // indirect
1319
)

go.sum

+8-11
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,17 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
1313
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1414
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1515
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
16-
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
17-
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1816
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
1917
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
20-
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
21-
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
22-
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
23-
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
24-
go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
25-
golang.org/x/sys v0.0.0-20220327210214-530d0810a4d0 h1:G6WAvvcMaaFYQhMbC0L5ZWNExEcJ3j3yFTxx4mwOHtM=
26-
golang.org/x/sys v0.0.0-20220327210214-530d0810a4d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18+
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
19+
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
20+
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
21+
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
22+
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
23+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2724
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2825
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
2926
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
3027
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
31-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
32-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
28+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
29+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

serial_open_android.go

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
//go:build android
9-
// +build android
109

1110
package serial
1211

serial_open_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
//go:build (linux && !android) || darwin || freebsd || openbsd
9-
// +build linux,!android darwin freebsd openbsd
109

1110
package serial
1211

serial_termsettings_android.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build android
8-
// +build android
98

109
package serial
1110

serial_termsettings_bsd.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build freebsd || openbsd
8-
// +build freebsd openbsd
98

109
package serial
1110

serial_termsettings_darwin.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build darwin
8-
// +build darwin
98

109
package serial
1110

serial_termsettings_linux.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build linux && !android && !ppc64le
8-
// +build linux,!android,!ppc64le
98

109
package serial
1110

serial_termsettings_linux_ppc64le.go

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// Code is identical to android implementation.
99

1010
//go:build linux && !android && ppc64le
11-
// +build linux,!android,ppc64le
1211

1312
package serial
1413

serial_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
//go:build linux || darwin || freebsd || openbsd
9-
// +build linux darwin freebsd openbsd
109

1110
package serial
1211

termios_baudrate_bsd.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build freebsd || openbsd
8-
// +build freebsd openbsd
98

109
package serial
1110

termios_baudrate_darwin.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build darwin
8-
// +build darwin
98

109
package serial
1110

termios_baudrate_linux.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build linux
8-
// +build linux
98

109
package serial
1110

termios_setting_darwin.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build darwin
8-
// +build darwin
98

109
package serial
1110

termios_setting_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build linux || freebsd || openbsd
8-
// +build linux freebsd openbsd
98

109
package serial
1110

termios_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build linux || darwin || freebsd || openbsd
8-
// +build linux darwin freebsd openbsd
98

109
package serial
1110

unixutils/select_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
//go:build linux || darwin || freebsd || openbsd
8-
// +build linux darwin freebsd openbsd
98

109
package unixutils
1110

0 commit comments

Comments
 (0)