From 565712014f3dfe01b0b5012ab46a7e26217538f2 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Mon, 29 Feb 2016 13:43:57 +0100 Subject: [PATCH] cliconfig: use a const for ".docker" string Signed-off-by: Antonio Murdaca --- cliconfig/config.go | 3 ++- image/v1/imagev1.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cliconfig/config.go b/cliconfig/config.go index f5b2be8a40..f0adfbf411 100644 --- a/cliconfig/config.go +++ b/cliconfig/config.go @@ -17,6 +17,7 @@ import ( const ( // ConfigFileName is the name of config file ConfigFileName = "config.json" + configFileDir = ".docker" oldConfigfile = ".dockercfg" // This constant is only used for really old config files when the @@ -31,7 +32,7 @@ var ( func init() { if configDir == "" { - configDir = filepath.Join(homedir.Get(), ".docker") + configDir = filepath.Join(homedir.Get(), configFileDir) } } diff --git a/image/v1/imagev1.go b/image/v1/imagev1.go index cc76fbfeec..1e45b62bd9 100644 --- a/image/v1/imagev1.go +++ b/image/v1/imagev1.go @@ -142,7 +142,7 @@ func rawJSON(value interface{}) *json.RawMessage { // ValidateID checks whether an ID string is a valid image ID. func ValidateID(id string) error { if ok := validHex.MatchString(id); !ok { - return fmt.Errorf("image ID '%s' is invalid ", id) + return fmt.Errorf("image ID %q is invalid", id) } return nil }