From 9cccdfe6a512e37563aee9cd5b15323cc6303502 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Wed, 1 Apr 2026 09:34:10 +0200 Subject: [PATCH] Fixup golangci-lint revive settings Using revive linter settings causes all default-enabled settings to be turned off. Use `nolint` to disable some single instances of revive linting rather than turning things off for the whole codebase. Signed-off-by: SuperQ --- .golangci.yml | 7 ------- client_linux.go | 18 +++++++++--------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bd0a99a..f81c487 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,13 +10,6 @@ linters: - common-false-positives - legacy - std-error-handling - settings: - revive: - rules: - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming - # Disable due to use of ALL_CAPS consts. - - name: var-naming - disabled: true formatters: exclusions: generated: lax diff --git a/client_linux.go b/client_linux.go index 720101c..88a8321 100644 --- a/client_linux.go +++ b/client_linux.go @@ -323,9 +323,9 @@ func (fec FEC) encode(ae *netlink.AttributeEncoder) { // Supported returns the supported/configured FEC modes. Some drivers report // supported, others configured. See // https://kernel.googlesource.com/pub/scm/network/ethtool/ethtool/+/2b3ddcb35357ae34ed0a6ae2bb006dcdaec353a9 -func (f *FEC) Supported() FECModes { - result := f.Modes - if f.Auto { +func (fec *FEC) Supported() FECModes { + result := fec.Modes + if fec.Auto { result |= unix.ETHTOOL_FEC_AUTO } return result @@ -822,12 +822,12 @@ func parseLinkState(msgs []genetlink.Message) ([]*LinkState, error) { // TODO: get these into x/sys/unix const ( - _ETHTOOL_A_FEC_UNSPEC = iota - _ETHTOOL_A_FEC_HEADER - _ETHTOOL_A_FEC_MODES - _ETHTOOL_A_FEC_AUTO - _ETHTOOL_A_FEC_ACTIVE - _ETHTOOL_A_FEC_STATS + _ETHTOOL_A_FEC_UNSPEC = iota //nolint:revive + _ETHTOOL_A_FEC_HEADER //nolint:revive + _ETHTOOL_A_FEC_MODES //nolint:revive + _ETHTOOL_A_FEC_AUTO //nolint:revive + _ETHTOOL_A_FEC_ACTIVE //nolint:revive + _ETHTOOL_A_FEC_STATS //nolint:revive ) // parseFEC parses FEC structures from a slice of generic netlink