Skip to content

Commit 4c07e9a

Browse files
committed
fix errors to use %d for ints
1 parent 1a6f61e commit 4c07e9a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

link_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (l *Link) SetLinkNetInNs(nspid int, ip net.IP, network *net.IPNet, gw *net.
224224
}
225225

226226
if err := netlink.NetworkLinkUp(l.ifc); err != nil {
227-
return fmt.Errorf("Unable to bring %s interface UP: %s", l.ifc.Name, nspid)
227+
return fmt.Errorf("Unable to bring %s interface UP: %d", l.ifc.Name, nspid)
228228
}
229229

230230
if gw != nil {
@@ -319,7 +319,7 @@ func setLinkOptions(ifc *net.Interface, opts LinkOptions) error {
319319
}
320320

321321
if err := netlink.NetworkLinkUp(ifc); err != nil {
322-
return fmt.Errorf("Unable to bring %s interface UP: %s", ifc.Name, ns)
322+
return fmt.Errorf("Unable to bring %s interface UP: %d", ifc.Name, ns)
323323
}
324324
}
325325
} else {

veth_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (veth *VethPair) SetPeerLinkNetInNs(nspid int, ip net.IP, network *net.IPNe
203203
}
204204

205205
if err := netlink.NetworkLinkUp(veth.peerIfc); err != nil {
206-
return fmt.Errorf("Unable to bring %s interface UP: %s", veth.peerIfc.Name, nspid)
206+
return fmt.Errorf("Unable to bring %s interface UP: %d", veth.peerIfc.Name, nspid)
207207
}
208208

209209
if gw != nil {

vlan_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Test_NewVlanLink(t *testing.T) {
3333

3434
vln, err := NewVlanLink(tt.masterDev, tt.id)
3535
if err != nil {
36-
t.Fatalf("NewVlanLink(%s, %s) failed to run: %s", tt.masterDev, tt.id, err)
36+
t.Fatalf("NewVlanLink(%s, %d) failed to run: %s", tt.masterDev, tt.id, err)
3737
}
3838

3939
vlnName := vln.NetInterface().Name

0 commit comments

Comments
 (0)