Skip to content

Commit

Permalink
Update Go version
Browse files Browse the repository at this point in the history
* Update Go to 1.20.
* Update minimum Go to 1.19.
* Update Go modules.
* Fix deprecated os/ioutil use.

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ committed May 16, 2023
1 parent 24c2637 commit a7abbeb
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Expand Up @@ -4,7 +4,7 @@ version: 2.1
jobs:
lint:
docker:
- image: cimg/go:1.19
- image: cimg/go:1.20
steps:
- checkout
- run: make check_license
Expand Down Expand Up @@ -55,15 +55,15 @@ workflows:
matrix:
parameters:
go_version:
- "1.18"
- "1.19"
- "1.20"
- test:
name: test-windows
os: windows
run_test: false
matrix:
parameters:
go_version:
- "1.18"
- "1.19"
- "1.20"
- codespell
6 changes: 3 additions & 3 deletions go.mod
@@ -1,9 +1,9 @@
module github.com/prometheus/procfs

go 1.18
go 1.19

require (
github.com/google/go-cmp v0.5.9
golang.org/x/sync v0.1.0
golang.org/x/sys v0.7.0
golang.org/x/sync v0.2.0
golang.org/x/sys v0.8.0
)
8 changes: 4 additions & 4 deletions go.sum
@@ -1,6 +1,6 @@
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
11 changes: 5 additions & 6 deletions sysfs/class_sas_device.go
Expand Up @@ -17,7 +17,6 @@
package sysfs

import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -53,7 +52,7 @@ var (
func (fs FS) parseSASDeviceClass(dir string) (SASDeviceClass, error) {
path := fs.sys.Path(dir)

dirs, err := ioutil.ReadDir(path)
dirs, err := os.ReadDir(path)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -97,7 +96,7 @@ func (fs FS) parseSASDevice(name string) (*SASDevice, error) {

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

dirs, err := ioutil.ReadDir(devicepath)
dirs, err := os.ReadDir(devicepath)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -139,7 +138,7 @@ func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) {

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

dirs, err := ioutil.ReadDir(devicepath)
dirs, err := os.ReadDir(devicepath)
if err != nil {
return nil, err
}
Expand All @@ -148,7 +147,7 @@ func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) {
if sasTargetDeviceRegexp.MatchString(d.Name()) {
targetdir := d.Name()

subtargets, err := ioutil.ReadDir(filepath.Join(devicepath, targetdir))
subtargets, err := os.ReadDir(filepath.Join(devicepath, targetdir))
if err != nil {
return nil, err
}
Expand All @@ -160,7 +159,7 @@ func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) {
continue
}

blocks, err := ioutil.ReadDir(filepath.Join(devicepath, targetdir, targetsubdir.Name(), "block"))
blocks, err := os.ReadDir(filepath.Join(devicepath, targetdir, targetsubdir.Name(), "block"))
if err != nil {
if os.IsNotExist(err) {
continue
Expand Down
6 changes: 3 additions & 3 deletions sysfs/class_sas_host.go
Expand Up @@ -17,7 +17,7 @@
package sysfs

import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
)
Expand Down Expand Up @@ -49,7 +49,7 @@ var (
func (fs FS) SASHostClass() (SASHostClass, error) {
path := fs.sys.Path(sasHostClassPath)

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

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

dirs, err := ioutil.ReadDir(devicepath)
dirs, err := os.ReadDir(devicepath)
if err != nil {
return nil, err
}
Expand Down
5 changes: 2 additions & 3 deletions sysfs/class_sas_phy.go
Expand Up @@ -18,7 +18,6 @@ package sysfs

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -54,7 +53,7 @@ type SASPhyClass map[string]*SASPhy
func (fs FS) SASPhyClass() (SASPhyClass, error) {
path := fs.sys.Path(sasPhyClassPath)

dirs, err := ioutil.ReadDir(path)
dirs, err := os.ReadDir(path)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -88,7 +87,7 @@ func (fs FS) parseSASPhy(name string) (*SASPhy, error) {
}
}

files, err := ioutil.ReadDir(phypath)
files, err := os.ReadDir(phypath)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions sysfs/class_sas_port.go
Expand Up @@ -17,7 +17,7 @@
package sysfs

import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
)
Expand Down Expand Up @@ -52,7 +52,7 @@ var (
func (fs FS) SASPortClass() (SASPortClass, error) {
path := fs.sys.Path(sasPortClassPath)

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

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

dirs, err := ioutil.ReadDir(portpath)
dirs, err := os.ReadDir(portpath)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a7abbeb

Please sign in to comment.