Skip to content

Commit bca17b8

Browse files
committed
fix go vet outputs: unreachable code and explicit attribute assigments
1 parent 2bad0a0 commit bca17b8

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

cmd/skupper/skupper_kube_site.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,13 @@ func (s *SkupperKubeSite) Status(cmd *cobra.Command, args []string) error {
280280
routerMode = currentSite.RouterStatus[0].Router.Mode
281281

282282
statusDataOutput := formatter.StatusData{
283-
EnabledIn: formatter.PlatformSupport{"kubernetes", currentSite.Site.Namespace},
284-
Mode: routerMode,
285-
SiteName: currentSite.Site.Name,
286-
Policies: currentSite.Site.Policy,
283+
EnabledIn: formatter.PlatformSupport{
284+
SupportType: "kubernetes",
285+
SupportName: currentSite.Site.Namespace,
286+
},
287+
Mode: routerMode,
288+
SiteName: currentSite.Site.Name,
289+
Policies: currentSite.Site.Policy,
287290
}
288291

289292
err, index := statusManager.GetRouterIndex(currentSite)
@@ -312,7 +315,10 @@ func (s *SkupperKubeSite) Status(cmd *cobra.Command, args []string) error {
312315
if siteConfig.Spec.EnableFlowCollector && consoleUrl != "" {
313316
statusDataOutput.ConsoleUrl = consoleUrl
314317
if siteConfig.Spec.AuthMode == "internal" {
315-
statusDataOutput.Credentials = formatter.PlatformSupport{"secret", "'skupper-console-users'"}
318+
statusDataOutput.Credentials = formatter.PlatformSupport{
319+
SupportType: "secret",
320+
SupportName: "'skupper-console-users'",
321+
}
316322
}
317323
}
318324
}

cmd/skupper/skupper_kube_token.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,11 @@ func (s *SkupperKubeToken) createFromTemplate(cmd *cobra.Command, args []string)
9999
fmt.Println()
100100
return nil
101101
}
102-
return nil
103102
case "claim":
104103
return fmt.Errorf("--template option cannot be used for a claim")
105104
default:
106105
return fmt.Errorf("invalid token type.")
107106
}
108-
return nil
109107
}
110108

111109
func (s *SkupperKubeToken) Status(cmd *cobra.Command, args []string) error {

cmd/skupper/skupper_podman_site.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ func (s *SkupperPodmanSite) Status(cmd *cobra.Command, args []string) error {
289289
}
290290

291291
statusOutput.Mode = site.GetMode()
292-
statusOutput.EnabledIn = formatter.PlatformSupport{"podman", podman.Username}
292+
statusOutput.EnabledIn = formatter.PlatformSupport{
293+
SupportType: "podman",
294+
SupportName: podman.Username,
295+
}
293296

294297
var currentSite = statusManager.GetSiteById(site.Id)
295298

@@ -313,7 +316,10 @@ func (s *SkupperPodmanSite) Status(cmd *cobra.Command, args []string) error {
313316
if site.EnableFlowCollector {
314317
statusOutput.ConsoleUrl = site.GetConsoleUrl()
315318
if site.AuthMode == "internal" {
316-
statusOutput.Credentials = formatter.PlatformSupport{"podman volume", "'skupper-console-users'"}
319+
statusOutput.Credentials = formatter.PlatformSupport{
320+
SupportType: "podman volume",
321+
SupportName: "'skupper-console-users'",
322+
}
317323
}
318324
}
319325

pkg/service_sync/messaging.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ func (c *sender) _send() error {
9898
}
9999
}
100100
}
101-
return nil
102101
}
103102

104103
type receiver struct {
@@ -160,5 +159,4 @@ func (c *receiver) _receive() error {
160159
c.updates <- update
161160
}
162161
}
163-
return nil
164162
}

0 commit comments

Comments
 (0)