Fix function comments based on best practices from Effective Go

Signed-off-by: CodeLingo Bot <bot@codelingo.io>
This commit is contained in:
CodeLingo Bot
2019-02-18 11:17:38 +00:00
committed by Alessandro Boch
parent e281812e70
commit f504738125
4 changed files with 5 additions and 5 deletions

View File

@@ -91,7 +91,7 @@ func (h *Handle) GetSocketReceiveBufferSize() ([]int, error) {
return results, nil return results, nil
} }
// NewHandle returns a netlink handle on the network namespace // NewHandleAt returns a netlink handle on the network namespace
// specified by ns. If ns=netns.None(), current network namespace // specified by ns. If ns=netns.None(), current network namespace
// will be assumed // will be assumed
func NewHandleAt(ns netns.NsHandle, nlFamilies ...int) (*Handle, error) { func NewHandleAt(ns netns.NsHandle, nlFamilies ...int) (*Handle, error) {

View File

@@ -501,7 +501,7 @@ func LinkSetVfSpoofchk(link Link, vf int, check bool) error {
return pkgHandle.LinkSetVfSpoofchk(link, vf, check) return pkgHandle.LinkSetVfSpoofchk(link, vf, check)
} }
// LinkSetVfSpookfchk enables/disables spoof check on a vf for the link. // LinkSetVfSpoofchk enables/disables spoof check on a vf for the link.
// Equivalent to: `ip link set $link vf $vf spoofchk $check` // Equivalent to: `ip link set $link vf $vf spoofchk $check`
func (h *Handle) LinkSetVfSpoofchk(link Link, vf int, check bool) error { func (h *Handle) LinkSetVfSpoofchk(link Link, vf int, check bool) error {
var setting uint32 var setting uint32

View File

@@ -51,14 +51,14 @@ func SetNetNsIdByPid(pid, nsid int) error {
return pkgHandle.SetNetNsIdByPid(pid, nsid) return pkgHandle.SetNetNsIdByPid(pid, nsid)
} }
// GetNetNsIdByPid looks up the network namespace ID for a given fd. // GetNetNsIdByFd looks up the network namespace ID for a given fd.
// fd must be an open file descriptor to a namespace file. // fd must be an open file descriptor to a namespace file.
// Returns -1 if the namespace does not have an ID set. // Returns -1 if the namespace does not have an ID set.
func (h *Handle) GetNetNsIdByFd(fd int) (int, error) { func (h *Handle) GetNetNsIdByFd(fd int) (int, error) {
return h.getNetNsId(NETNSA_FD, uint32(fd)) return h.getNetNsId(NETNSA_FD, uint32(fd))
} }
// GetNetNsIdByPid looks up the network namespace ID for a given fd. // GetNetNsIdByFd looks up the network namespace ID for a given fd.
// fd must be an open file descriptor to a namespace file. // fd must be an open file descriptor to a namespace file.
// Returns -1 if the namespace does not have an ID set. // Returns -1 if the namespace does not have an ID set.
func GetNetNsIdByFd(fd int) (int, error) { func GetNetNsIdByFd(fd int) (int, error) {

View File

@@ -46,7 +46,7 @@ func GetIPFamily(ip net.IP) int {
var nativeEndian binary.ByteOrder var nativeEndian binary.ByteOrder
// Get native endianness for the system // NativeEndian gets native endianness for the system
func NativeEndian() binary.ByteOrder { func NativeEndian() binary.ByteOrder {
if nativeEndian == nil { if nativeEndian == nil {
var x uint32 = 0x01020304 var x uint32 = 0x01020304