gofmt: style violations have crept up

This commit is contained in:
Eugene Yakubovich 2014-10-28 17:22:52 -07:00
parent 0e908ca36d
commit ffab401087
9 changed files with 14 additions and 19 deletions

View File

@ -175,10 +175,10 @@ func boolAttr(val bool) []byte {
}
type vxlanPortRange struct {
Lo, Hi uint16
}
Lo, Hi uint16
}
func addVxlanAttrs(vxlan* Vxlan, linkInfo *nl.RtAttr) {
func addVxlanAttrs(vxlan *Vxlan, linkInfo *nl.RtAttr) {
data := nl.NewRtAttrChild(linkInfo, nl.IFLA_INFO_DATA, nil)
nl.NewRtAttrChild(data, nl.IFLA_VXLAN_ID, nl.Uint32Attr(uint32(vxlan.VxlanId)))
if vxlan.VtepDevIndex != 0 {
@ -227,7 +227,7 @@ func addVxlanAttrs(vxlan* Vxlan, linkInfo *nl.RtAttr) {
nl.NewRtAttrChild(data, nl.IFLA_VXLAN_PORT, nl.Uint16Attr(uint16(vxlan.Port)))
}
if vxlan.PortLow > 0 || vxlan.PortHigh > 0 {
pr := vxlanPortRange{ uint16(vxlan.PortLow), uint16(vxlan.PortHigh) }
pr := vxlanPortRange{uint16(vxlan.PortLow), uint16(vxlan.PortHigh)}
buf := new(bytes.Buffer)
binary.Write(buf, binary.BigEndian, &pr)

View File

@ -349,7 +349,7 @@ func TestLinkAddDelVxlan(t *testing.T) {
LinkAttrs: LinkAttrs{
Name: "bar",
},
VxlanId: 10,
VxlanId: 10,
VtepDevIndex: parent.Index,
Learning: true,
L2miss: true,

View File

@ -47,7 +47,7 @@ type Ndmsg struct {
Family uint8
Index uint32
State uint16
Flags uint8
Flags uint8
Type uint8
}
@ -171,7 +171,6 @@ func NeighDeserialize(m []byte) (*Neigh, error) {
Flags: int(msg.Flags),
}
attrs, err := nl.ParseRouteAttr(m[msg.Len():])
if err != nil {
return nil, err

View File

@ -20,7 +20,7 @@ func parseMAC(s string) net.HardwareAddr {
func dumpContains(dump []Neigh, e arpEntry) bool {
for _, n := range dump {
if n.IP.Equal(e.ip) && (n.State & NUD_INCOMPLETE) == 0 {
if n.IP.Equal(e.ip) && (n.State&NUD_INCOMPLETE) == 0 {
return true
}
}
@ -36,11 +36,11 @@ func TestNeighAddDel(t *testing.T) {
ensureIndex(dummy.Attrs())
arpTable := []arpEntry{
{ net.ParseIP("10.99.0.1"), parseMAC("aa:bb:cc:dd:00:01") },
{ net.ParseIP("10.99.0.2"), parseMAC("aa:bb:cc:dd:00:02") },
{ net.ParseIP("10.99.0.3"), parseMAC("aa:bb:cc:dd:00:03") },
{ net.ParseIP("10.99.0.4"), parseMAC("aa:bb:cc:dd:00:04") },
{ net.ParseIP("10.99.0.5"), parseMAC("aa:bb:cc:dd:00:05") },
{net.ParseIP("10.99.0.1"), parseMAC("aa:bb:cc:dd:00:01")},
{net.ParseIP("10.99.0.2"), parseMAC("aa:bb:cc:dd:00:02")},
{net.ParseIP("10.99.0.3"), parseMAC("aa:bb:cc:dd:00:03")},
{net.ParseIP("10.99.0.4"), parseMAC("aa:bb:cc:dd:00:04")},
{net.ParseIP("10.99.0.5"), parseMAC("aa:bb:cc:dd:00:05")},
}
// Add the arpTable

View File

@ -45,4 +45,3 @@ func (msg *IfAddrmsg) Serialize() []byte {
func (msg *IfAddrmsg) Len() int {
return syscall.SizeofIfAddrmsg
}

View File

@ -4,8 +4,8 @@ package nl
import (
"bytes"
"encoding/binary"
"net"
"fmt"
"net"
"sync/atomic"
"syscall"
"unsafe"
@ -304,7 +304,7 @@ func Subscribe(protocol int, groups ...uint) (*NetlinkSocket, error) {
s.lsa.Family = syscall.AF_NETLINK
for _, g := range groups {
s.lsa.Groups |= (1 << (g-1))
s.lsa.Groups |= (1 << (g - 1))
}
if err := syscall.Bind(fd, &s.lsa); err != nil {

View File

@ -31,4 +31,3 @@ func DeserializeRtMsg(b []byte) *RtMsg {
func (msg *RtMsg) Serialize() []byte {
return (*(*[syscall.SizeofRtMsg]byte)(unsafe.Pointer(msg)))[:]
}

View File

@ -117,4 +117,3 @@ func DeserializeXfrmUserTmpl(b []byte) *XfrmUserTmpl {
func (msg *XfrmUserTmpl) Serialize() []byte {
return (*(*[SizeofXfrmUserTmpl]byte)(unsafe.Pointer(msg)))[:]
}

View File

@ -219,4 +219,3 @@ func DeserializeXfrmEncapTmpl(b []byte) *XfrmEncapTmpl {
func (msg *XfrmEncapTmpl) Serialize() []byte {
return (*(*[SizeofXfrmEncapTmpl]byte)(unsafe.Pointer(msg)))[:]
}