Skip to content

Commit

Permalink
Fix function comments based on best practices from Effective Go
Browse files Browse the repository at this point in the history
Signed-off-by: CodeLingo Bot <[email protected]>
  • Loading branch information
CodeLingoBot authored and aboch committed Mar 19, 2019
1 parent e281812 commit f504738
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion handle_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (h *Handle) GetSocketReceiveBufferSize() ([]int, error) {
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
// will be assumed
func NewHandleAt(ns netns.NsHandle, nlFamilies ...int) (*Handle, error) {
Expand Down
2 changes: 1 addition & 1 deletion link_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ func LinkSetVfSpoofchk(link Link, vf int, check bool) error {
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`
func (h *Handle) LinkSetVfSpoofchk(link Link, vf int, check bool) error {
var setting uint32
Expand Down
4 changes: 2 additions & 2 deletions netns_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ func SetNetNsIdByPid(pid, nsid int) error {
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.
// Returns -1 if the namespace does not have an ID set.
func (h *Handle) GetNetNsIdByFd(fd int) (int, error) {
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.
// Returns -1 if the namespace does not have an ID set.
func GetNetNsIdByFd(fd int) (int, error) {
Expand Down
2 changes: 1 addition & 1 deletion nl/nl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func GetIPFamily(ip net.IP) int {

var nativeEndian binary.ByteOrder

// Get native endianness for the system
// NativeEndian gets native endianness for the system
func NativeEndian() binary.ByteOrder {
if nativeEndian == nil {
var x uint32 = 0x01020304
Expand Down

0 comments on commit f504738

Please sign in to comment.