Skip to content

Commit ac93201

Browse files
committed
Golint fixes
1 parent 77e55e0 commit ac93201

File tree

10 files changed

+14
-6
lines changed

10 files changed

+14
-6
lines changed

pkg/api/cache.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ type ScalewayResolverResult struct {
7070
RankMatch int
7171
}
7272

73+
// ScalewayResolverResults is a list of `ScalewayResolverResult`
7374
type ScalewayResolverResults []ScalewayResolverResult
7475

7576
func (s ScalewayResolverResults) Len() int {
@@ -191,6 +192,7 @@ func (c *ScalewayCache) Save() error {
191192
return nil
192193
}
193194

195+
// ComputeRankMatch fills `ScalewayResolverResult.RankMatch` with its `fuzzy` score
194196
func (s *ScalewayResolverResult) ComputeRankMatch(needle string) {
195197
s.Needle = needle
196198
s.RankMatch = fuzzy.RankMatch(needle, s.Name)

pkg/cli/command.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/scaleway/scaleway-cli/pkg/commands"
2020
)
2121

22+
// Command contains everything needed by the cli main loop to calls the workflow, display help and usage, and the context
2223
type Command struct {
2324
// Exec executes the command
2425
Exec func(cmd *Command, args []string)

pkg/cli/commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Docker-style commands to manage BareMetal servers
66

7-
// Package commands contains CLI commands
7+
// Package cli contains CLI commands
88
package cli
99

1010
// Commands is the list of enabled CLI commands

pkg/commands/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE.md file.
44

5-
// Golang structs for scw commands
5+
// Package commands contains the workflows behind each commands of the CLI (run, attach, start, exec, commit, ...)
66
package commands
77

88
import (

pkg/commands/cp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/archive"
1919
)
2020

21+
// CpArgs are arguments passed to `RunCp`
2122
type CpArgs struct {
2223
Gateway string
2324
Source string
@@ -27,7 +28,7 @@ type CpArgs struct {
2728
// RunCp is the handler for 'scw cp'
2829
func RunCp(ctx CommandContext, args CpArgs) error {
2930
if strings.Count(args.Source, ":") > 1 || strings.Count(args.Destination, ":") > 1 {
30-
return fmt.Errorf("bad usage, see 'scw help cp'.")
31+
return fmt.Errorf("bad usage, see 'scw help cp'")
3132
}
3233

3334
sourceStream, err := TarFromSource(ctx, args.Source, args.Gateway)

pkg/commands/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/scaleway/scaleway-cli/pkg/api"
1212
)
1313

14+
// CreateArgs are arguments passed to `RunCreate`
1415
type CreateArgs struct {
1516
Name string
1617
Bootscript string

pkg/commands/events.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/units"
1212
)
1313

14+
// EventsArgs are arguments passed to `RunEvents`
1415
type EventsArgs struct{}
1516

1617
// RunEvents is the handler for 'scw events'

pkg/commands/login.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/scaleway/scaleway-cli/pkg/utils"
1919
)
2020

21+
// LoginArgs are arguments passed to `RunLogin`
2122
type LoginArgs struct {
2223
Organization string
2324
Token string

pkg/commands/rename.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ func RunRename(ctx CommandContext, args RenameArgs) error {
2626
err := ctx.API.PatchServer(serverID, server)
2727
if err != nil {
2828
return fmt.Errorf("cannot rename server: %v", err)
29-
} else {
30-
ctx.API.Cache.InsertServer(serverID, *server.Name)
3129
}
30+
31+
ctx.API.Cache.InsertServer(serverID, *server.Name)
32+
3233
return nil
3334
}

pkg/commands/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// VersionArgs are flags for the `RunVersion` function
1515
type VersionArgs struct{}
1616

17-
// RunVersion is the handler for 'scw version'
17+
// Version is the handler for 'scw version'
1818
func Version(ctx CommandContext, args VersionArgs) error {
1919
fmt.Fprintf(ctx.Stdout, "Client version: %s\n", scwversion.VERSION)
2020
fmt.Fprintf(ctx.Stdout, "Go version (client): %s\n", runtime.Version())

0 commit comments

Comments
 (0)