Skip to content

Commit 69fc8f6

Browse files
authored
*: s/(%v|%s)/%w and use go1.20 (#617)
* *: `s/(%v|%s)/%w` for all `fmt.Errorf` errors The `%w` verb was introduced in `go1.20` which allows for error wrapping. However, even though the minimum supported version was specified as `go1.19` there are already sparse occurences of the `%w` verb throughout the codebase. Hence it's safe to move the minimum supported version to `go1.20` since its constructs have been in use within the repository for a while now. Refer: https://go.dev/doc/go1.20#errors Fixes: #519 Signed-off-by: Pranshu Srivastava <[email protected]> * chore: Specify minimum Golang version as `1.20` PTAL at the previous commit (d559fd9) for more details. Signed-off-by: Pranshu Srivastava <[email protected]> * fixup! chore: Specify minimum Golang version as `1.20` Signed-off-by: Pranshu Srivastava <[email protected]> --------- Signed-off-by: Pranshu Srivastava <[email protected]>
1 parent eac8540 commit 69fc8f6

29 files changed

+99
-101
lines changed

Diff for: .circleci/config.yml

-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ workflows:
4646
matrix:
4747
parameters:
4848
go_version:
49-
- "1.19"
5049
- "1.20"
5150
- "1.21"
5251
- test:
@@ -56,6 +55,5 @@ workflows:
5655
matrix:
5756
parameters:
5857
go_version:
59-
- "1.19"
6058
- "1.20"
6159
- "1.21"

Diff for: arp.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type ARPEntry struct {
5555
func (fs FS) GatherARPEntries() ([]ARPEntry, error) {
5656
data, err := os.ReadFile(fs.proc.Path("net/arp"))
5757
if err != nil {
58-
return nil, fmt.Errorf("%s: error reading arp %s: %w", ErrFileRead, fs.proc.Path("net/arp"), err)
58+
return nil, fmt.Errorf("%w: error reading arp %s: %w", ErrFileRead, fs.proc.Path("net/arp"), err)
5959
}
6060

6161
return parseARPEntries(data)
@@ -78,11 +78,11 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) {
7878
} else if width == expectedDataWidth {
7979
entry, err := parseARPEntry(columns)
8080
if err != nil {
81-
return []ARPEntry{}, fmt.Errorf("%s: Failed to parse ARP entry: %v: %w", ErrFileParse, entry, err)
81+
return []ARPEntry{}, fmt.Errorf("%w: Failed to parse ARP entry: %v: %w", ErrFileParse, entry, err)
8282
}
8383
entries = append(entries, entry)
8484
} else {
85-
return []ARPEntry{}, fmt.Errorf("%s: %d columns found, but expected %d: %w", ErrFileParse, width, expectedDataWidth, err)
85+
return []ARPEntry{}, fmt.Errorf("%w: %d columns found, but expected %d: %w", ErrFileParse, width, expectedDataWidth, err)
8686
}
8787

8888
}

Diff for: buddyinfo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) {
7474
for i := 0; i < arraySize; i++ {
7575
sizes[i], err = strconv.ParseFloat(parts[i+4], 64)
7676
if err != nil {
77-
return nil, fmt.Errorf("%s: Invalid valid in buddyinfo: %f: %w", ErrFileParse, sizes[i], err)
77+
return nil, fmt.Errorf("%w: Invalid valid in buddyinfo: %f: %w", ErrFileParse, sizes[i], err)
7878
}
7979
}
8080

Diff for: cpuinfo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func parseCPUInfoARM(info []byte) ([]CPUInfo, error) {
194194
firstLine := firstNonEmptyLine(scanner)
195195
match, err := regexp.MatchString("^[Pp]rocessor", firstLine)
196196
if !match || !strings.Contains(firstLine, ":") {
197-
return nil, fmt.Errorf("%s: Cannot parse line: %q: %w", ErrFileParse, firstLine, err)
197+
return nil, fmt.Errorf("%w: Cannot parse line: %q: %w", ErrFileParse, firstLine, err)
198198

199199
}
200200
field := strings.SplitN(firstLine, ": ", 2)

Diff for: crypto.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ func (fs FS) Crypto() ([]Crypto, error) {
5555
path := fs.proc.Path("crypto")
5656
b, err := util.ReadFileNoStat(path)
5757
if err != nil {
58-
return nil, fmt.Errorf("%s: Cannot read file %v: %w", ErrFileRead, b, err)
58+
return nil, fmt.Errorf("%w: Cannot read file %v: %w", ErrFileRead, b, err)
5959

6060
}
6161

6262
crypto, err := parseCrypto(bytes.NewReader(b))
6363
if err != nil {
64-
return nil, fmt.Errorf("%s: Cannot parse %v: %w", ErrFileParse, crypto, err)
64+
return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, crypto, err)
6565
}
6666

6767
return crypto, nil

Diff for: fscache.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) {
236236

237237
m, err := parseFscacheinfo(bytes.NewReader(b))
238238
if err != nil {
239-
return Fscacheinfo{}, fmt.Errorf("%s: Cannot parse %v: %w", ErrFileParse, m, err)
239+
return Fscacheinfo{}, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, m, err)
240240
}
241241

242242
return *m, nil
@@ -245,7 +245,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) {
245245
func setFSCacheFields(fields []string, setFields ...*uint64) error {
246246
var err error
247247
if len(fields) < len(setFields) {
248-
return fmt.Errorf("%s: Expected %d, but got %d: %w", ErrFileParse, len(setFields), len(fields), err)
248+
return fmt.Errorf("%w: Expected %d, but got %d: %w", ErrFileParse, len(setFields), len(fields), err)
249249
}
250250

251251
for i := range setFields {

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/prometheus/procfs
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/google/go-cmp v0.6.0

Diff for: ipvs.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,16 @@ func parseIPPort(s string) (net.IP, uint16, error) {
221221
case 46:
222222
ip = net.ParseIP(s[1:40])
223223
if ip == nil {
224-
return nil, 0, fmt.Errorf("%s: Invalid IPv6 addr %s: %w", ErrFileParse, s[1:40], err)
224+
return nil, 0, fmt.Errorf("%w: Invalid IPv6 addr %s: %w", ErrFileParse, s[1:40], err)
225225
}
226226
default:
227-
return nil, 0, fmt.Errorf("%s: Unexpected IP:Port %s: %w", ErrFileParse, s, err)
227+
return nil, 0, fmt.Errorf("%w: Unexpected IP:Port %s: %w", ErrFileParse, s, err)
228228
}
229229

230230
portString := s[len(s)-4:]
231231
if len(portString) != 4 {
232232
return nil, 0,
233-
fmt.Errorf("%s: Unexpected port string format %s: %w", ErrFileParse, portString, err)
233+
fmt.Errorf("%w: Unexpected port string format %s: %w", ErrFileParse, portString, err)
234234
}
235235
port, err := strconv.ParseUint(portString, 16, 16)
236236
if err != nil {

Diff for: loadavg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func parseLoad(loadavgBytes []byte) (*LoadAvg, error) {
5151
for i, load := range parts[0:3] {
5252
loads[i], err = strconv.ParseFloat(load, 64)
5353
if err != nil {
54-
return nil, fmt.Errorf("%s: Cannot parse load: %f: %w", ErrFileParse, loads[i], err)
54+
return nil, fmt.Errorf("%w: Cannot parse load: %f: %w", ErrFileParse, loads[i], err)
5555
}
5656
}
5757
return &LoadAvg{

Diff for: mdstat.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (fs FS) MDStat() ([]MDStat, error) {
7070
}
7171
mdstat, err := parseMDStat(data)
7272
if err != nil {
73-
return nil, fmt.Errorf("%s: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err)
73+
return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err)
7474
}
7575
return mdstat, nil
7676
}
@@ -90,7 +90,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
9090

9191
deviceFields := strings.Fields(line)
9292
if len(deviceFields) < 3 {
93-
return nil, fmt.Errorf("%s: Expected 3+ lines, got %q", ErrFileParse, line)
93+
return nil, fmt.Errorf("%w: Expected 3+ lines, got %q", ErrFileParse, line)
9494
}
9595
mdName := deviceFields[0] // mdx
9696
state := deviceFields[2] // active or inactive
@@ -105,7 +105,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
105105
active, total, down, size, err := evalStatusLine(lines[i], lines[i+1])
106106

107107
if err != nil {
108-
return nil, fmt.Errorf("%s: Cannot parse md device lines: %v: %w", ErrFileParse, active, err)
108+
return nil, fmt.Errorf("%w: Cannot parse md device lines: %v: %w", ErrFileParse, active, err)
109109
}
110110

111111
syncLineIdx := i + 2
@@ -140,7 +140,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
140140
} else {
141141
syncedBlocks, pct, finish, speed, err = evalRecoveryLine(lines[syncLineIdx])
142142
if err != nil {
143-
return nil, fmt.Errorf("%s: Cannot parse sync line in md device: %q: %w", ErrFileParse, mdName, err)
143+
return nil, fmt.Errorf("%w: Cannot parse sync line in md device: %q: %w", ErrFileParse, mdName, err)
144144
}
145145
}
146146
}
@@ -168,13 +168,13 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
168168
func evalStatusLine(deviceLine, statusLine string) (active, total, down, size int64, err error) {
169169
statusFields := strings.Fields(statusLine)
170170
if len(statusFields) < 1 {
171-
return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
171+
return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
172172
}
173173

174174
sizeStr := statusFields[0]
175175
size, err = strconv.ParseInt(sizeStr, 10, 64)
176176
if err != nil {
177-
return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
177+
return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
178178
}
179179

180180
if strings.Contains(deviceLine, "raid0") || strings.Contains(deviceLine, "linear") {
@@ -189,17 +189,17 @@ func evalStatusLine(deviceLine, statusLine string) (active, total, down, size in
189189

190190
matches := statusLineRE.FindStringSubmatch(statusLine)
191191
if len(matches) != 5 {
192-
return 0, 0, 0, 0, fmt.Errorf("%s: Could not fild all substring matches %s: %w", ErrFileParse, statusLine, err)
192+
return 0, 0, 0, 0, fmt.Errorf("%w: Could not fild all substring matches %s: %w", ErrFileParse, statusLine, err)
193193
}
194194

195195
total, err = strconv.ParseInt(matches[2], 10, 64)
196196
if err != nil {
197-
return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
197+
return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
198198
}
199199

200200
active, err = strconv.ParseInt(matches[3], 10, 64)
201201
if err != nil {
202-
return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected active %d: %w", ErrFileParse, active, err)
202+
return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected active %d: %w", ErrFileParse, active, err)
203203
}
204204
down = int64(strings.Count(matches[4], "_"))
205205

@@ -209,12 +209,12 @@ func evalStatusLine(deviceLine, statusLine string) (active, total, down, size in
209209
func evalRecoveryLine(recoveryLine string) (syncedBlocks int64, pct float64, finish float64, speed float64, err error) {
210210
matches := recoveryLineBlocksRE.FindStringSubmatch(recoveryLine)
211211
if len(matches) != 2 {
212-
return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected recoveryLine %s: %w", ErrFileParse, recoveryLine, err)
212+
return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine %s: %w", ErrFileParse, recoveryLine, err)
213213
}
214214

215215
syncedBlocks, err = strconv.ParseInt(matches[1], 10, 64)
216216
if err != nil {
217-
return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected parsing of recoveryLine %q: %w", ErrFileParse, recoveryLine, err)
217+
return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected parsing of recoveryLine %q: %w", ErrFileParse, recoveryLine, err)
218218
}
219219

220220
// Get percentage complete
@@ -244,7 +244,7 @@ func evalRecoveryLine(recoveryLine string) (syncedBlocks int64, pct float64, fin
244244
}
245245
speed, err = strconv.ParseFloat(matches[1], 64)
246246
if err != nil {
247-
return syncedBlocks, pct, finish, 0, fmt.Errorf("%s: Error parsing float from recoveryLine: %q: %w", ErrFileParse, recoveryLine, err)
247+
return syncedBlocks, pct, finish, 0, fmt.Errorf("%w: Error parsing float from recoveryLine: %q: %w", ErrFileParse, recoveryLine, err)
248248
}
249249

250250
return syncedBlocks, pct, finish, speed, nil

Diff for: meminfo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (fs FS) Meminfo() (Meminfo, error) {
202202

203203
m, err := parseMemInfo(bytes.NewReader(b))
204204
if err != nil {
205-
return Meminfo{}, fmt.Errorf("%s: %w", ErrFileParse, err)
205+
return Meminfo{}, fmt.Errorf("%w: %w", ErrFileParse, err)
206206
}
207207

208208
return *m, nil

Diff for: mountinfo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func parseMountInfoString(mountString string) (*MountInfo, error) {
109109
if mountInfo[6] != "" {
110110
mount.OptionalFields, err = mountOptionsParseOptionalFields(mountInfo[6 : mountInfoLength-4])
111111
if err != nil {
112-
return nil, fmt.Errorf("%s: %w", ErrFileParse, err)
112+
return nil, fmt.Errorf("%w: %w", ErrFileParse, err)
113113
}
114114
}
115115
return mount, nil

Diff for: mountstats.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
627627
return nil, fmt.Errorf("%w: invalid NFS transport stats 1.1 statement: %v, protocol: %v", ErrFileParse, ss, protocol)
628628
}
629629
default:
630-
return nil, fmt.Errorf("%s: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol)
630+
return nil, fmt.Errorf("%w: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol)
631631
}
632632

633633
// Allocate enough for v1.1 stats since zero value for v1.1 stats will be okay

Diff for: net_conntrackstat.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func readConntrackStat(path string) ([]ConntrackStatEntry, error) {
5858

5959
stat, err := parseConntrackStat(bytes.NewReader(b))
6060
if err != nil {
61-
return nil, fmt.Errorf("%s: Cannot read file: %v: %w", ErrFileRead, path, err)
61+
return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, path, err)
6262
}
6363

6464
return stat, nil
@@ -86,7 +86,7 @@ func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) {
8686
func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) {
8787
entries, err := util.ParseHexUint64s(fields)
8888
if err != nil {
89-
return nil, fmt.Errorf("%s: Cannot parse entry: %d: %w", ErrFileParse, entries, err)
89+
return nil, fmt.Errorf("%w: Cannot parse entry: %d: %w", ErrFileParse, entries, err)
9090
}
9191
numEntries := len(entries)
9292
if numEntries < 16 || numEntries > 17 {

Diff for: net_ip_socket.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func parseIP(hexIP string) (net.IP, error) {
141141
var byteIP []byte
142142
byteIP, err := hex.DecodeString(hexIP)
143143
if err != nil {
144-
return nil, fmt.Errorf("%s: Cannot parse socket field in %q: %w", ErrFileParse, hexIP, err)
144+
return nil, fmt.Errorf("%w: Cannot parse socket field in %q: %w", ErrFileParse, hexIP, err)
145145
}
146146
switch len(byteIP) {
147147
case 4:
@@ -155,7 +155,7 @@ func parseIP(hexIP string) (net.IP, error) {
155155
}
156156
return i, nil
157157
default:
158-
return nil, fmt.Errorf("%s: Unable to parse IP %s: %w", ErrFileParse, hexIP, nil)
158+
return nil, fmt.Errorf("%w: Unable to parse IP %s: %v", ErrFileParse, hexIP, nil)
159159
}
160160
}
161161

@@ -178,7 +178,7 @@ func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error)
178178
}
179179

180180
if line.Sl, err = strconv.ParseUint(s[0], 0, 64); err != nil {
181-
return nil, fmt.Errorf("%s: Unable to parse sl field in %q: %w", ErrFileParse, line.Sl, err)
181+
return nil, fmt.Errorf("%w: Unable to parse sl field in %q: %w", ErrFileParse, line.Sl, err)
182182
}
183183
// local_address
184184
l := strings.Split(fields[1], ":")
@@ -189,7 +189,7 @@ func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error)
189189
return nil, err
190190
}
191191
if line.LocalPort, err = strconv.ParseUint(l[1], 16, 64); err != nil {
192-
return nil, fmt.Errorf("%s: Unable to parse local_address port value line %q: %w", ErrFileParse, line.LocalPort, err)
192+
return nil, fmt.Errorf("%w: Unable to parse local_address port value line %q: %w", ErrFileParse, line.LocalPort, err)
193193
}
194194

195195
// remote_address
@@ -201,12 +201,12 @@ func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error)
201201
return nil, err
202202
}
203203
if line.RemPort, err = strconv.ParseUint(r[1], 16, 64); err != nil {
204-
return nil, fmt.Errorf("%s: Cannot parse rem_address port value in %q: %w", ErrFileParse, line.RemPort, err)
204+
return nil, fmt.Errorf("%w: Cannot parse rem_address port value in %q: %w", ErrFileParse, line.RemPort, err)
205205
}
206206

207207
// st
208208
if line.St, err = strconv.ParseUint(fields[3], 16, 64); err != nil {
209-
return nil, fmt.Errorf("%s: Cannot parse st value in %q: %w", ErrFileParse, line.St, err)
209+
return nil, fmt.Errorf("%w: Cannot parse st value in %q: %w", ErrFileParse, line.St, err)
210210
}
211211

212212
// tx_queue and rx_queue
@@ -219,27 +219,27 @@ func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error)
219219
)
220220
}
221221
if line.TxQueue, err = strconv.ParseUint(q[0], 16, 64); err != nil {
222-
return nil, fmt.Errorf("%s: Cannot parse tx_queue value in %q: %w", ErrFileParse, line.TxQueue, err)
222+
return nil, fmt.Errorf("%w: Cannot parse tx_queue value in %q: %w", ErrFileParse, line.TxQueue, err)
223223
}
224224
if line.RxQueue, err = strconv.ParseUint(q[1], 16, 64); err != nil {
225-
return nil, fmt.Errorf("%s: Cannot parse trx_queue value in %q: %w", ErrFileParse, line.RxQueue, err)
225+
return nil, fmt.Errorf("%w: Cannot parse trx_queue value in %q: %w", ErrFileParse, line.RxQueue, err)
226226
}
227227

228228
// uid
229229
if line.UID, err = strconv.ParseUint(fields[7], 0, 64); err != nil {
230-
return nil, fmt.Errorf("%s: Cannot parse UID value in %q: %w", ErrFileParse, line.UID, err)
230+
return nil, fmt.Errorf("%w: Cannot parse UID value in %q: %w", ErrFileParse, line.UID, err)
231231
}
232232

233233
// inode
234234
if line.Inode, err = strconv.ParseUint(fields[9], 0, 64); err != nil {
235-
return nil, fmt.Errorf("%s: Cannot parse inode value in %q: %w", ErrFileParse, line.Inode, err)
235+
return nil, fmt.Errorf("%w: Cannot parse inode value in %q: %w", ErrFileParse, line.Inode, err)
236236
}
237237

238238
// drops
239239
if isUDP {
240240
drops, err := strconv.ParseUint(fields[12], 0, 64)
241241
if err != nil {
242-
return nil, fmt.Errorf("%s: Cannot parse drops value in %q: %w", ErrFileParse, drops, err)
242+
return nil, fmt.Errorf("%w: Cannot parse drops value in %q: %w", ErrFileParse, drops, err)
243243
}
244244
line.Drops = &drops
245245
}

Diff for: net_sockstat.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func readSockstat(name string) (*NetSockstat, error) {
6969

7070
stat, err := parseSockstat(bytes.NewReader(b))
7171
if err != nil {
72-
return nil, fmt.Errorf("%s: sockstats from %q: %w", ErrFileRead, name, err)
72+
return nil, fmt.Errorf("%w: sockstats from %q: %w", ErrFileRead, name, err)
7373
}
7474

7575
return stat, nil
@@ -89,7 +89,7 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) {
8989
// The remaining fields are key/value pairs.
9090
kvs, err := parseSockstatKVs(fields[1:])
9191
if err != nil {
92-
return nil, fmt.Errorf("%s: sockstat key/value pairs from %q: %w", ErrFileParse, s.Text(), err)
92+
return nil, fmt.Errorf("%w: sockstat key/value pairs from %q: %w", ErrFileParse, s.Text(), err)
9393
}
9494

9595
// The first field is the protocol. We must trim its colon suffix.

Diff for: net_softnet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) {
6464

6565
entries, err := parseSoftnet(bytes.NewReader(b))
6666
if err != nil {
67-
return nil, fmt.Errorf("%s: /proc/net/softnet_stat: %w", ErrFileParse, err)
67+
return nil, fmt.Errorf("%w: /proc/net/softnet_stat: %w", ErrFileParse, err)
6868
}
6969

7070
return entries, nil

0 commit comments

Comments
 (0)