Skip to content

Commit f489b53

Browse files
authored
Update Go version (#521)
* Update Go to 1.20. * Update minimum Go to 1.19. * Update Go modules. * Fix deprecated os/ioutil use. Signed-off-by: SuperQ <[email protected]>
1 parent 24c2637 commit f489b53

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2.1
44
jobs:
55
lint:
66
docker:
7-
- image: cimg/go:1.19
7+
- image: cimg/go:1.20
88
steps:
99
- checkout
1010
- run: make check_license
@@ -55,15 +55,15 @@ workflows:
5555
matrix:
5656
parameters:
5757
go_version:
58-
- "1.18"
5958
- "1.19"
59+
- "1.20"
6060
- test:
6161
name: test-windows
6262
os: windows
6363
run_test: false
6464
matrix:
6565
parameters:
6666
go_version:
67-
- "1.18"
6867
- "1.19"
68+
- "1.20"
6969
- codespell

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module github.com/prometheus/procfs
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/google/go-cmp v0.5.9
7-
golang.org/x/sync v0.1.0
8-
golang.org/x/sys v0.7.0
7+
golang.org/x/sync v0.2.0
8+
golang.org/x/sys v0.8.0
99
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
22
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3-
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
4-
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5-
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
6-
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3+
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
4+
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5+
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
6+
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

sysfs/class_sas_device.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package sysfs
1818

1919
import (
20-
"io/ioutil"
2120
"os"
2221
"path/filepath"
2322
"regexp"
@@ -53,7 +52,7 @@ var (
5352
func (fs FS) parseSASDeviceClass(dir string) (SASDeviceClass, error) {
5453
path := fs.sys.Path(dir)
5554

56-
dirs, err := ioutil.ReadDir(path)
55+
dirs, err := os.ReadDir(path)
5756
if err != nil {
5857
return nil, err
5958
}
@@ -97,7 +96,7 @@ func (fs FS) parseSASDevice(name string) (*SASDevice, error) {
9796

9897
devicepath := fs.sys.Path(filepath.Join(sasDeviceClassPath, name, "device"))
9998

100-
dirs, err := ioutil.ReadDir(devicepath)
99+
dirs, err := os.ReadDir(devicepath)
101100
if err != nil {
102101
return nil, err
103102
}
@@ -139,7 +138,7 @@ func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) {
139138

140139
devicepath := fs.sys.Path(filepath.Join(sasDeviceClassPath, name, "device"))
141140

142-
dirs, err := ioutil.ReadDir(devicepath)
141+
dirs, err := os.ReadDir(devicepath)
143142
if err != nil {
144143
return nil, err
145144
}
@@ -148,7 +147,7 @@ func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) {
148147
if sasTargetDeviceRegexp.MatchString(d.Name()) {
149148
targetdir := d.Name()
150149

151-
subtargets, err := ioutil.ReadDir(filepath.Join(devicepath, targetdir))
150+
subtargets, err := os.ReadDir(filepath.Join(devicepath, targetdir))
152151
if err != nil {
153152
return nil, err
154153
}
@@ -160,7 +159,7 @@ func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) {
160159
continue
161160
}
162161

163-
blocks, err := ioutil.ReadDir(filepath.Join(devicepath, targetdir, targetsubdir.Name(), "block"))
162+
blocks, err := os.ReadDir(filepath.Join(devicepath, targetdir, targetsubdir.Name(), "block"))
164163
if err != nil {
165164
if os.IsNotExist(err) {
166165
continue

sysfs/class_sas_host.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package sysfs
1818

1919
import (
20-
"io/ioutil"
20+
"os"
2121
"path/filepath"
2222
"regexp"
2323
)
@@ -49,7 +49,7 @@ var (
4949
func (fs FS) SASHostClass() (SASHostClass, error) {
5050
path := fs.sys.Path(sasHostClassPath)
5151

52-
dirs, err := ioutil.ReadDir(path)
52+
dirs, err := os.ReadDir(path)
5353
if err != nil {
5454
return nil, err
5555
}
@@ -75,7 +75,7 @@ func (fs FS) parseSASHost(name string) (*SASHost, error) {
7575

7676
devicepath := fs.sys.Path(filepath.Join(sasHostClassPath, name, "device"))
7777

78-
dirs, err := ioutil.ReadDir(devicepath)
78+
dirs, err := os.ReadDir(devicepath)
7979
if err != nil {
8080
return nil, err
8181
}

sysfs/class_sas_phy.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package sysfs
1818

1919
import (
2020
"fmt"
21-
"io/ioutil"
2221
"os"
2322
"path/filepath"
2423
"strconv"
@@ -54,7 +53,7 @@ type SASPhyClass map[string]*SASPhy
5453
func (fs FS) SASPhyClass() (SASPhyClass, error) {
5554
path := fs.sys.Path(sasPhyClassPath)
5655

57-
dirs, err := ioutil.ReadDir(path)
56+
dirs, err := os.ReadDir(path)
5857
if err != nil {
5958
return nil, err
6059
}
@@ -88,7 +87,7 @@ func (fs FS) parseSASPhy(name string) (*SASPhy, error) {
8887
}
8988
}
9089

91-
files, err := ioutil.ReadDir(phypath)
90+
files, err := os.ReadDir(phypath)
9291
if err != nil {
9392
return nil, err
9493
}

sysfs/class_sas_port.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package sysfs
1818

1919
import (
20-
"io/ioutil"
20+
"os"
2121
"path/filepath"
2222
"regexp"
2323
)
@@ -52,7 +52,7 @@ var (
5252
func (fs FS) SASPortClass() (SASPortClass, error) {
5353
path := fs.sys.Path(sasPortClassPath)
5454

55-
dirs, err := ioutil.ReadDir(path)
55+
dirs, err := os.ReadDir(path)
5656
if err != nil {
5757
return nil, err
5858
}
@@ -77,7 +77,7 @@ func (fs FS) parseSASPort(name string) (*SASPort, error) {
7777

7878
portpath := fs.sys.Path(filepath.Join(sasPortClassPath, name, "device"))
7979

80-
dirs, err := ioutil.ReadDir(portpath)
80+
dirs, err := os.ReadDir(portpath)
8181
if err != nil {
8282
return nil, err
8383
}

0 commit comments

Comments
 (0)