mirror of https://github.com/golang/go.git
net: add missing error handling on Plan 9
This commit is contained in:
parent
56c9f8e8cf
commit
fdad0e8764
|
|
@ -152,8 +152,12 @@ func interfaceAddrTable(ifi *Interface) ([]Addr, error) {
|
|||
}
|
||||
defer statusf.close()
|
||||
|
||||
// Read but ignore first line as it only contains the table header.
|
||||
// See https://9p.io/magic/man2html/3/ip
|
||||
if _, ok := statusf.readLine(); !ok {
|
||||
return nil, errors.New("cannot read header line for interface: " + status)
|
||||
}
|
||||
line, ok := statusf.readLine()
|
||||
line, ok = statusf.readLine()
|
||||
if !ok {
|
||||
return nil, errors.New("cannot parse IP address for interface: " + status)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue