Skip to content

Commit

Permalink
golangci: disable godot, nestif and testpackage
Browse files Browse the repository at this point in the history
Did fix some godot violations before disabling, but it's not a very good
linter x)
  • Loading branch information
fsouza committed Apr 23, 2020
1 parent dd8b321 commit a8121b9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ linters:
- gochecknoglobals
- gocognit
- goconst
- godot
- gomnd
- lll
- nestif
- testpackage
- wsl
15 changes: 12 additions & 3 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,18 @@ func cfgPaths(dockerConfigEnv string, homeEnv string) []string {
return nil
}

// NewAuthConfigurationsFromDockerCfg returns AuthConfigurations from
// system config files. The following files are checked in the order listed:
// - $DOCKER_CONFIG/config.json if DOCKER_CONFIG set in the environment,
// NewAuthConfigurationsFromDockerCfg returns AuthConfigurations from system
// config files. The following files are checked in the order listed:
//
// If the environment variable DOCKER_CONFIG is set to a non-empty string:
//
// - $DOCKER_CONFIG/plaintext-passwords.json
// - $DOCKER_CONFIG/config.json
//
// Otherwise, it looks for files in the $HOME directory and the legacy
// location:
//
// - $HOME/.docker/plaintext-passwords.json
// - $HOME/.docker/config.json
// - $HOME/.dockercfg
func NewAuthConfigurationsFromDockerCfg() (*AuthConfigurations, error) {
Expand Down
9 changes: 4 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,22 @@ func (version APIVersion) String() string {
return strings.Join(parts, ".")
}

// LessThan is a function for comparing APIVersion structs
// LessThan is a function for comparing APIVersion structs.
func (version APIVersion) LessThan(other APIVersion) bool {
return version.compare(other) < 0
}

// LessThanOrEqualTo is a function for comparing APIVersion structs
// LessThanOrEqualTo is a function for comparing APIVersion structs.
func (version APIVersion) LessThanOrEqualTo(other APIVersion) bool {
return version.compare(other) <= 0
}

// GreaterThan is a function for comparing APIVersion structs
// GreaterThan is a function for comparing APIVersion structs.
func (version APIVersion) GreaterThan(other APIVersion) bool {
return version.compare(other) > 0
}

// GreaterThanOrEqualTo is a function for comparing APIVersion structs
// GreaterThanOrEqualTo is a function for comparing APIVersion structs.
func (version APIVersion) GreaterThanOrEqualTo(other APIVersion) bool {
return version.compare(other) >= 0
}
Expand Down Expand Up @@ -509,7 +509,6 @@ type streamOptions struct {
context context.Context
}

// if error in context, return that instead of generic http error
func chooseError(ctx context.Context, err error) error {
select {
case <-ctx.Done():
Expand Down

0 comments on commit a8121b9

Please sign in to comment.