Skip to content

Commit

Permalink
Address nonamedreturns linter violations
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and skitt committed Nov 18, 2024
1 parent 66be51b commit a64ffe6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/cableengine/syncer/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,6 @@ func (m *equalGatewayMatcher) FailureMessage(actual interface{}) string {
return format.Message(actual, "to equal", m.expected)
}

func (m *equalGatewayMatcher) NegatedFailureMessage(actual interface{}) (message string) {
func (m *equalGatewayMatcher) NegatedFailureMessage(actual interface{}) string {
return format.Message(actual, "not to equal", m.expected)
}
10 changes: 5 additions & 5 deletions pkg/netlink/fake/netlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,15 @@ func (n *basicType) ConfigureTCPMTUProbe(_, _ string) error {
return nil
}

func (n *NetLink) AwaitLink(name string) (link netlink.Link) {
func (n *NetLink) AwaitLink(name string) netlink.Link {
var link netlink.Link

Eventually(func() netlink.Link {
link, _ = n.LinkByName(name)
return link
}, 5).ShouldNot(BeNil(), "Link %q not found", name)

return
return link
}

func (n *NetLink) AwaitNoLink(name string) {
Expand All @@ -466,7 +468,7 @@ func (n *NetLink) AwaitNoLink(name string) {
}, 5).Should(BeTrue(), "Link %q exists", name)
}

func (n *NetLink) AwaitLinkSetup(name string) (link netlink.Link) {
func (n *NetLink) AwaitLinkSetup(name string) {
Eventually(func() bool {
n.basic().mutex.Lock()
defer n.basic().mutex.Unlock()
Expand All @@ -478,8 +480,6 @@ func (n *NetLink) AwaitLinkSetup(name string) (link netlink.Link) {

return false
}, 5).Should(BeTrue(), "Link %q not setup", name)

return
}

func routeList[T any](n *NetLink, linkIndex, table int, f func(r *netlink.Route) *T) []T {
Expand Down
2 changes: 1 addition & 1 deletion pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (

var logger = log.Logger{Logger: logf.Log.WithName("ovs-vsctl")}

func vsctlCmd(parameters ...string) (output string, err error) {
func vsctlCmd(parameters ...string) (string, error) {
allParameters := []string{fmt.Sprintf("--timeout=%d", ovsCommandTimeout)}
allParameters = append(allParameters, parameters...)

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/clusterfiles/cluster_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var logger = log.Logger{Logger: logf.Log.WithName("ClusterFiles")}
// using an url schema that supports configmap://<namespace>/<configmap-name>/<data-file>
// secret://<namespace>/<secret-name>/<data-file> and file:///<path> returning
// a local path to the file.
func Get(k8sClient kubernetes.Interface, urlAddress string) (pathStr string, err error) {
func Get(k8sClient kubernetes.Interface, urlAddress string) (string, error) {
logger.V(log.DEBUG).Infof("Reading cluster_file: %s", urlAddress)

parsedURL, err := url.Parse(urlAddress)
Expand Down

0 comments on commit a64ffe6

Please sign in to comment.