Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 81c5367

Browse files
committed
Linter fixes
Signed-off-by: Ulysses Souza <[email protected]>
1 parent 25b3359 commit 81c5367

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

aci/compose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (cs *aciComposeService) Ps(ctx context.Context, projectName string, options
231231
}
232232

233233
func checkUnsupportedPsOptions(ctx context.Context, o api.PsOptions) error {
234-
return utils.CheckUnsupported(ctx,nil, o.All, false, "ps", "all")
234+
return utils.CheckUnsupported(ctx, nil, o.All, false, "ps", "all")
235235
}
236236

237237
func (cs *aciComposeService) List(ctx context.Context, opts api.ListOptions) ([]api.Stack, error) {

api/config/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ import (
2727
"github.com/docker/compose-cli/api/context/store"
2828
)
2929

30-
const ContextTypeKey = "context_type"
30+
// ContextKey defines a type for keys in the context passed
31+
type ContextKey string
32+
33+
// ContextTypeKey is the key for context type stored in context.Context
34+
const ContextTypeKey ContextKey = "context_type"
3135

3236
var configDir string
3337

cli/config/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ type ConfigFlags struct {
3535

3636
// AddConfigFlags adds persistent (global) flags
3737
func (c *ConfigFlags) AddConfigFlags(flags *pflag.FlagSet) {
38-
flags.StringVar(&c.Config, config.ConfigFlagName, ConfDir(), "Location of the client config files `DIRECTORY`")
38+
flags.StringVar(&c.Config, config.ConfigFlagName, confDir(), "Location of the client config files `DIRECTORY`")
3939
}
4040

41-
func ConfDir() string {
41+
func confDir() string {
4242
env := os.Getenv("DOCKER_CONFIG")
4343
if env != "" {
4444
return env

utils/check.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/pkg/errors"
2828
)
2929

30+
// CheckUnsupported checks if a flag was used when it shouldn't and adds an error in case
3031
func CheckUnsupported(ctx context.Context, errs error, toCheck, expectedValue interface{}, commandName, msg string) error {
3132
if !(isNil(toCheck) && isNil(expectedValue)) && toCheck != expectedValue {
3233
ctype := ctx.Value(config.ContextTypeKey).(string)

utils/units.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ func isNil(i interface{}) bool {
6262
return reflect.ValueOf(i).IsNil()
6363
}
6464
return false
65-
}
65+
}

0 commit comments

Comments
 (0)