Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix various linting issues #1048

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

thaJeztah
Copy link
Contributor

More to come, but these were fairly trivial fixes.

@thaJeztah thaJeztah mentioned this pull request Jan 20, 2025
    link_linux.go:2913:6: func `addBondSlaveAttrs` is unused (unused)
    func addBondSlaveAttrs(bondSlave *BondSlave, linkInfo *nl.RtAttr) {
         ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    neigh_linux.go:125:6: func `neighAdd` is unused (unused)
    func neighAdd(neigh *Neigh, mode int) error {
         ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    qdisc_linux.go:770:6: func `time2Ktime` is unused (unused)
    func time2Ktime(time uint32) uint32 {
         ^
    qdisc_linux.go:774:6: func `ktime2Time` is unused (unused)
    func ktime2Time(ktime uint32) uint32 {
         ^
    qdisc_linux.go:778:6: func `burst` is unused (unused)
    func burst(rate uint64, buffer uint32) uint32 {
         ^
    qdisc_linux.go:782:6: func `latency` is unused (unused)
    func latency(rate uint64, limit, buffer uint32) float64 {
         ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
…govet)

    conntrack_linux.go:186:30: printf: non-constant format string in call to fmt.Errorf (govet)
            return matched, fmt.Errorf(strings.Join(errMsgs, "; "))
                                       ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    devlink_linux.go:327:7: S1009: should omit nil check; len() for []byte is defined as zero (gosimple)
                if rawData != nil && len(rawData) == 1 {
                   ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    addr_linux.go:159:16: composites: github.com/vishvananda/netlink/nl.IfaCacheInfo struct literal uses unkeyed fields (govet)
            cachedata := nl.IfaCacheInfo{unix.IfaCacheinfo{
                         ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    conntrack_linux.go:501:6: func `parseRaw32` is unused (unused)
    func parseRaw32(r *bytes.Reader, v *uint32) {
         ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
    netlink_test.go:57:6: S1005: unnecessary assignment to the blank identifier (gosimple)
            if found, _ := foundRequiredMods[name]; !found {
               ^
    netlink_test.go:221:6: S1005: unnecessary assignment to the blank identifier (gosimple)
            if found, _ := foundRequiredMods[name]; !found {
               ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    conntrack_linux.go:639:19: ineffectual assignment to l (ineffassign)
                    if nested, t, l = parseNfAttrTL(reader); nested && t == nl.CTA_TUPLE_IP {
                                  ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    devlink_linux.go:262:2: field `rawData` is unused (unused)
        rawData []byte
        ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…error

    route_test.go:1023:8: ineffectual assignment to err (ineffassign)
        link, err := setUpRoutesBench(b)
              ^
    route_test.go:1046:8: ineffectual assignment to err (ineffassign)
        link, err := setUpRoutesBench(b)
              ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the fix_linting branch 2 times, most recently from 7e059ff to f309a37 Compare January 21, 2025 09:11
    nl/tc_linux.go:1079:2: const `__TCA_FLOWER_MAX` is unused (unused)
        __TCA_FLOWER_MAX
        ^
    ioctl_linux.go:31:2: const `_ETH_SS_NTUPLE_FILTERS` is unused (unused)
        _ETH_SS_NTUPLE_FILTERS
        ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant