Skip to content

Commit d959057

Browse files
committed
fix staticcheck
Signed-off-by: Jess Frazelle <[email protected]>
1 parent 067711f commit d959057

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

clair/layer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ func (c *Clair) DeleteLayer(ctx context.Context, name string) error {
8585
return nil
8686
}
8787

88-
return fmt.Errorf("Got status code: %d", resp.StatusCode)
88+
return fmt.Errorf("got status code: %d", resp.StatusCode)
8989
}

list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (cmd *listCommand) Run(ctx context.Context, args []string) error {
3838
repos, err := r.Catalog(ctx, "")
3939
if err != nil {
4040
if _, ok := err.(*json.SyntaxError); ok {
41-
return fmt.Errorf("Domain %s is not a valid registry", r.Domain)
41+
return fmt.Errorf("domain %s is not a valid registry", r.Domain)
4242
}
4343
return err
4444
}

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func main() {
7878
// Set the before function.
7979
p.Before = func(ctx context.Context) error {
8080
// On ^C, or SIGTERM handle exit.
81-
signals := make(chan os.Signal, 0)
81+
signals := make(chan os.Signal)
8282
signal.Notify(signals, os.Interrupt)
8383
signal.Notify(signals, syscall.SIGTERM)
8484
_, cancel := context.WithCancel(ctx)
@@ -115,7 +115,7 @@ func createRegistryClient(ctx context.Context, domain string) (*registry.Registr
115115

116116
// Prevent non-ssl unless explicitly forced
117117
if !forceNonSSL && strings.HasPrefix(auth.ServerAddress, "http:") {
118-
return nil, fmt.Errorf("Attempted to use insecure protocol! Use force-non-ssl option to force")
118+
return nil, fmt.Errorf("attempted to use insecure protocol! Use force-non-ssl option to force")
119119
}
120120

121121
// Create the registry client.

registry/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ func (r *Registry) Delete(ctx context.Context, repository string, digest digest.
3232
return nil
3333
}
3434

35-
return fmt.Errorf("Got status code: %d", resp.StatusCode)
35+
return fmt.Errorf("got status code: %d", resp.StatusCode)
3636
}

registry/digest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (r *Registry) Digest(ctx context.Context, image Image) (digest.Digest, erro
3333
defer resp.Body.Close()
3434

3535
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound {
36-
return "", fmt.Errorf("Got status code: %d", resp.StatusCode)
36+
return "", fmt.Errorf("got status code: %d", resp.StatusCode)
3737
}
3838

3939
return digest.Parse(resp.Header.Get("Docker-Content-Digest"))

registry/tokentransport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (r *Registry) Token(ctx context.Context, url string) (string, error) {
195195
defer resp.Body.Close()
196196

197197
if resp.StatusCode != http.StatusOK {
198-
return "", fmt.Errorf("Getting token failed with StatusCode != StatusOK but %d", resp.StatusCode)
198+
return "", fmt.Errorf("getting token failed with StatusCode != StatusOK but %d", resp.StatusCode)
199199
}
200200

201201
var authToken authToken

repoutils/repoutils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func GetAuthConfig(username, password, registry string) (types.AuthConfig, error
3131

3232
dcfg, err := config.Load(config.Dir())
3333
if err != nil {
34-
return types.AuthConfig{}, fmt.Errorf("Loading config file failed: %v", err)
34+
return types.AuthConfig{}, fmt.Errorf("loading config file failed: %v", err)
3535
}
3636

3737
// return error early if there are no auths saved
@@ -49,7 +49,7 @@ func GetAuthConfig(username, password, registry string) (types.AuthConfig, error
4949

5050
authConfigs, err := dcfg.GetAllCredentials()
5151
if err != nil {
52-
return types.AuthConfig{}, fmt.Errorf("Getting credentials failed: %v", err)
52+
return types.AuthConfig{}, fmt.Errorf("getting credentials failed: %v", err)
5353
}
5454

5555
// if they passed a specific registry, return those creds _if_ they exist

repoutils/repoutils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestGetAuthConfig(t *testing.T) {
3535
{
3636
name: "invalid config dir",
3737
configdir: "testdata/invalid",
38-
err: errors.New("Loading config file failed: "),
38+
err: errors.New("loading config file failed: "),
3939
config: types.AuthConfig{},
4040
},
4141
{

testutils/testutils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
func StartRegistry(dcli *client.Client, config, username, password string) (string, string, error) {
3434
_, filename, _, ok := runtime.Caller(0)
3535
if !ok {
36-
return "", "", errors.New("No caller information")
36+
return "", "", errors.New("no caller information")
3737
}
3838

3939
image := "registry:2"
@@ -126,7 +126,7 @@ func startClairDB(dcli *client.Client) (string, error) {
126126
func StartClair(dcli *client.Client) (string, string, error) {
127127
_, filename, _, ok := runtime.Caller(0)
128128
if !ok {
129-
return "", "", errors.New("No caller information")
129+
return "", "", errors.New("no caller information")
130130
}
131131

132132
// start the database container.
@@ -284,7 +284,7 @@ func imageExists(dcli *client.Client, image string) (bool, error) {
284284
func waitForConn(addr, cert, key string) error {
285285
tlsCert, err := tls.LoadX509KeyPair(cert, key)
286286
if err != nil {
287-
return fmt.Errorf("Could not load X509 key pair: %v. Make sure the key is not encrypted", err)
287+
return fmt.Errorf("could not load X509 key pair: %v. Make sure the key is not encrypted", err)
288288
}
289289

290290
certPool, err := x509.SystemCertPool()

0 commit comments

Comments
 (0)