Repository: apigee/registry
Pull request #1093 (2023-03-15 15:15:01)

address staticcheck lint errors
addresses all non-generated linter errors for #744

codecov[bot]: ## [Codecov](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) Report
> Merging [#1093](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) (45d7f15) into [main](https://codecov.io/gh/apigee/registry/commit/007e2715f640fa00ffe5a34085876ac2595dd024?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) (007e271) will **not change** coverage.
> The diff coverage is `27.27%`.

```diff
@@           Coverage Diff           @@
##             main    #1093   +/-   ##
=======================================
  Coverage   68.33%   68.33%           
=======================================
  Files         146      146           
  Lines       11999    11999           
=======================================
  Hits         8200     8200           
  Misses       3093     3093           
  Partials      706      706           
```


| [Impacted Files](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) | Coverage Δ | |
|---|---|---|
| [cmd/registry/cmd/auth/print\_token.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC9hdXRoL3ByaW50X3Rva2VuLmdv) | `51.72% <0.00%> (ø)` | |
| [cmd/registry/cmd/config/configurations/activate.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC9jb25maWcvY29uZmlndXJhdGlvbnMvYWN0aXZhdGUuZ28=) | `60.86% <0.00%> (ø)` | |
| [cmd/registry/cmd/config/configurations/create.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC9jb25maWcvY29uZmlndXJhdGlvbnMvY3JlYXRlLmdv) | `66.66% <0.00%> (ø)` | |
| [cmd/registry/cmd/config/configurations/describe.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC9jb25maWcvY29uZmlndXJhdGlvbnMvZGVzY3JpYmUuZ28=) | `75.67% <0.00%> (ø)` | |
| [cmd/registry/cmd/config/configurations/list.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC9jb25maWcvY29uZmlndXJhdGlvbnMvbGlzdC5nbw==) | `82.35% <0.00%> (ø)` | |
| [cmd/registry/cmd/upload/discovery.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC91cGxvYWQvZGlzY292ZXJ5Lmdv) | `65.03% <0.00%> (ø)` | |
| [cmd/registry/cmd/upload/openapi.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC91cGxvYWQvb3BlbmFwaS5nbw==) | `68.87% <0.00%> (ø)` | |
| [cmd/registry/cmd/upload/protos.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC91cGxvYWQvcHJvdG9zLmdv) | `67.04% <0.00%> (ø)` | |
| [cmd/registry/conformance/conformance-task.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NvbmZvcm1hbmNlL2NvbmZvcm1hbmNlLXRhc2suZ28=) | `45.50% <0.00%> (ø)` | |
| [cmd/registry/controller/controller.go](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NvbnRyb2xsZXIvY29udHJvbGxlci5nbw==) | `76.34% <0.00%> (ø)` | |
| ... and [12 more](https://codecov.io/gh/apigee/registry/pull/1093?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) | |

:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee)


Patch:
diff --git a/cmd/registry/cmd/auth/print_token.go b/cmd/registry/cmd/auth/print_token.go
index 760fb22..17e2260 100644
--- a/cmd/registry/cmd/auth/print_token.go
+++ b/cmd/registry/cmd/auth/print_token.go
@@ -33,7 +33,7 @@ func printTokenCommand() *cobra.Command {
 			_, c, err := config.ActiveRaw()
 			if err != nil {
 				if err == config.ErrNoActiveConfiguration {
-					return fmt.Errorf(`No active configuration. Use 'registry config configurations' to manage.`)
+					return fmt.Errorf(`no active configuration, use 'registry config configurations' to manage`)
 				}
 				return err
 			}
@@ -43,7 +43,7 @@ func printTokenCommand() *cobra.Command {
 			}
 
 			if c.TokenSource == "" {
-				return fmt.Errorf("No token source found. Use `registry config set token-source` to define.")
+				return fmt.Errorf("no token source found, use `registry config set token-source` to define")
 			}
 
 			token, err := genToken(c.TokenSource)
diff --git a/cmd/registry/cmd/check/rules/rule1000/rule1000.go b/cmd/registry/cmd/check/rules/rule1000/rule1000.go
index 85f8db4..5a536e9 100644
--- a/cmd/registry/cmd/check/rules/rule1000/rule1000.go
+++ b/cmd/registry/cmd/check/rules/rule1000/rule1000.go
@@ -65,7 +65,7 @@ var requiredArtifacts = &lint.ProjectRule{
 			found[a.GetName()] = true
 
 			name, _ := names.ParseArtifact(a.GetName())
-			if "apihub-taxonomies" == name.ArtifactID() {
+			if name.ArtifactID() == "apihub-taxonomies" {
 				probs = append(probs, checkTaxonomies(a)...)
 			}
 
diff --git a/cmd/registry/cmd/config/configurations/activate.go b/cmd/registry/cmd/config/configurations/activate.go
index 963d6ab..cf15bee 100644
--- a/cmd/registry/cmd/config/configurations/activate.go
+++ b/cmd/registry/cmd/config/configurations/activate.go
@@ -36,12 +36,12 @@ func activateCommand() *cobra.Command {
 
 			_, err := config.Read(name)
 			if err != nil {
-				return fmt.Errorf("Cannot read config %q: %v", name, err)
+				return fmt.Errorf("cannot read config %q: %v", name, err)
 			}
 
 			err = config.Activate(name)
 			if err != nil {
-				return fmt.Errorf("Cannot activate config %q: %v", name, err)
+				return fmt.Errorf("cannot activate config %q: %v", name, err)
 			}
 
 			cmd.Printf("Activated %q.\n", name)
diff --git a/cmd/registry/cmd/config/configurations/create.go b/cmd/registry/cmd/config/configurations/create.go
index fd6aaab..24d9c34 100644
--- a/cmd/registry/cmd/config/configurations/create.go
+++ b/cmd/registry/cmd/config/configurations/create.go
@@ -38,7 +38,7 @@ func createCommand() *cobra.Command {
 			}
 
 			if _, err := config.Read(name); err == nil {
-				return fmt.Errorf("Cannot create config %q, it already exists.", name)
+				return fmt.Errorf("cannot create config %q, it already exists", name)
 			}
 
 			// attempt to clone the active config or at least the current flags
@@ -51,13 +51,13 @@ func createCommand() *cobra.Command {
 
 			err = s.Write(name)
 			if err != nil {
-				return fmt.Errorf("Cannot create config %q: %v", name, err)
+				return fmt.Errorf("cannot create config %q: %v", name, err)
 			}
 			cmd.Printf("Created %q.\n", name)
 
 			err = config.Activate(name)
 			if err != nil {
-				return fmt.Errorf("Cannot activate config %q: %v", name, err)
+				return fmt.Errorf("cannot activate config %q: %v", name, err)
 			}
 			cmd.Printf("Activated %q.\n", name)
 			return nil
diff --git a/cmd/registry/cmd/config/configurations/delete.go b/cmd/registry/cmd/config/configurations/delete.go
index b58e636..8110121 100644
--- a/cmd/registry/cmd/config/configurations/delete.go
+++ b/cmd/registry/cmd/config/configurations/delete.go
@@ -48,7 +48,7 @@ func deleteCommand() *cobra.Command {
 				if yn == "" || yn == "y" || yn == "yes" {
 					break
 				} else if yn == "n" || yn == "no" {
-					return fmt.Errorf("Aborted by user.")
+					return fmt.Errorf("aborted by user")
 				}
 				cmd.Print("Please enter 'y' or 'n': ")
 			}
@@ -56,7 +56,7 @@ func deleteCommand() *cobra.Command {
 			for _, name := range args {
 				err := config.Delete(name)
 				if err != nil {
-					return fmt.Errorf("Cannot delete config %q: %v.", name, err)
+					return fmt.Errorf("cannot delete config %q: %v", name, err)
 				}
 				cmd.Printf("Deleted %q.\n", name)
 			}
diff --git a/cmd/registry/cmd/config/configurations/describe.go b/cmd/registry/cmd/config/configurations/describe.go
index cdbcb69..24733ea 100644
--- a/cmd/registry/cmd/config/configurations/describe.go
+++ b/cmd/registry/cmd/config/configurations/describe.go
@@ -33,16 +33,16 @@ func describeCommand() *cobra.Command {
 			name := args[0]
 			s, err := config.Read(name)
 			if err != nil {
-				return fmt.Errorf("Cannot read config %q: %v", name, err)
+				return fmt.Errorf("cannot read config %q: %v", name, err)
 			}
 			settingsMap, err := s.FlatMap()
 			if err != nil {
-				return fmt.Errorf("Cannot decode config %q: %v", name, err)
+				return fmt.Errorf("cannot decode config %q: %v", name, err)
 			}
 
 			activeName, err := config.ActiveName()
 			if err != nil {
-				return fmt.Errorf("Cannot read active config %q: %v", name, err)
+				return fmt.Errorf("cannot read active config %q: %v", name, err)
 			}
 
 			sortedNames := make([]string, 0, len(settingsMap))
diff --git a/cmd/registry/cmd/config/configurations/list.go b/cmd/registry/cmd/config/configurations/list.go
index b751fa7..5c4eb1e 100644
--- a/cmd/registry/cmd/config/configurations/list.go
+++ b/cmd/registry/cmd/config/configurations/list.go
@@ -38,12 +38,12 @@ func listCommand() *cobra.Command {
 				cmd.Println("You don't have any configurations. Run 'registry config configurations create' to create a configuration.")
 				return nil
 			} else if err != nil {
-				return fmt.Errorf("Cannot read configs: %v", err)
+				return fmt.Errorf("cannot read configs: %v", err)
 			}
 
 			activeName, err := config.ActiveName()
 			if err != nil {
-				return fmt.Errorf("Cannot read active config: %v", err)
+				return fmt.Errorf("cannot read active config: %v", err)
 			}
 
 			names := make([]string, 0, len(configs))
diff --git a/cmd/registry/cmd/config/get.go b/cmd/registry/cmd/config/get.go
index 90f8584..f1fe98a 100644
--- a/cmd/registry/cmd/config/get.go
+++ b/cmd/registry/cmd/config/get.go
@@ -32,9 +32,9 @@ func getCommand() *cobra.Command {
 			_, c, err := config.ActiveRaw()
 			if err != nil {
 				if err == config.ErrNoActiveConfiguration {
-					return fmt.Errorf(`No active configuration. Use 'registry config configurations' to manage.`)
+					return fmt.Errorf(`no active configuration, use 'registry config configurations' to manage`)
 				}
-				return fmt.Errorf("Cannot read config: %v", err)
+				return fmt.Errorf("cannot read config: %v", err)
 			}
 
 			if !contains(c.Properties(), args[0]) {
@@ -43,7 +43,7 @@ func getCommand() *cobra.Command {
 
 			v, err := c.Get(args[0])
 			if err != nil {
-				return fmt.Errorf("Cannot decode config: %v", err)
+				return fmt.Errorf("cannot decode config: %v", err)
 			}
 
 			cmd.Println(v)
diff --git a/cmd/registry/cmd/config/list.go b/cmd/registry/cmd/config/list.go
index bfff641..f2d4012 100644
--- a/cmd/registry/cmd/config/list.go
+++ b/cmd/registry/cmd/config/list.go
@@ -32,14 +32,14 @@ func listCommand() *cobra.Command {
 			target, c, err := config.ActiveRaw()
 			if err != nil {
 				if err == config.ErrNoActiveConfiguration {
-					return fmt.Errorf(`No active configuration. Use 'registry config configurations' to manage.`)
+					return fmt.Errorf(`no active configuration, use 'registry config configurations' to manage`)
 				}
-				return fmt.Errorf("Cannot read config: %v", err)
+				return fmt.Errorf("cannot read config: %v", err)
 			}
 
 			m, err := c.FlatMap()
 			if err != nil {
-				return fmt.Errorf("Cannot decode config: %v", err)
+				return fmt.Errorf("cannot decode config: %v", err)
 			}
 			for _, p := range c.Properties() {
 				if m[p] != nil {
diff --git a/cmd/registry/cmd/config/set.go b/cmd/registry/cmd/config/set.go
index 1be7d79..f8bda57 100644
--- a/cmd/registry/cmd/config/set.go
+++ b/cmd/registry/cmd/config/set.go
@@ -40,9 +40,9 @@ func setCommand() *cobra.Command {
 			target, c, err := config.ActiveRaw()
 			if err != nil {
 				if err == config.ErrNoActiveConfiguration {
-					return fmt.Errorf(`No active configuration. Use 'registry config configurations' to manage.`)
+					return fmt.Errorf(`no active configuration, use 'registry config configurations' to manage`)
 				}
-				return fmt.Errorf("Cannot read config: %v", err)
+				return fmt.Errorf("cannot read config: %v", err)
 			}
 
 			name, value := args[0], args[1]
@@ -51,11 +51,11 @@ func setCommand() *cobra.Command {
 			}
 
 			if err = c.Set(name, value); err != nil {
-				return fmt.Errorf("Cannot set value: %v", err)
+				return fmt.Errorf("cannot set value: %v", err)
 			}
 
 			if err = c.Write(target); err != nil {
-				return fmt.Errorf("Cannot write config: %v", err)
+				return fmt.Errorf("cannot write config: %v", err)
 			}
 
 			cmd.Printf("Updated property %q.\n", name)
diff --git a/cmd/registry/cmd/config/unset.go b/cmd/registry/cmd/config/unset.go
index a6a888f..0ccac38 100644
--- a/cmd/registry/cmd/config/unset.go
+++ b/cmd/registry/cmd/config/unset.go
@@ -32,17 +32,17 @@ func unsetCommand() *cobra.Command {
 			target, c, err := config.ActiveRaw()
 			if err != nil {
 				if err == config.ErrNoActiveConfiguration {
-					return fmt.Errorf(`No active configuration. Use 'registry config configurations' to manage.`)
+					return fmt.Errorf(`no active configuration, use 'registry config configurations' to manage`)
 				}
-				return fmt.Errorf("Cannot read config: %v", err)
+				return fmt.Errorf("cannot read config: %v", err)
 			}
 
 			if err = c.Unset(args[0]); err != nil {
-				return fmt.Errorf("Cannot unset property: %v", err)
+				return fmt.Errorf("cannot unset property: %v", err)
 			}
 
 			if err = c.Write(target); err != nil {
-				return fmt.Errorf("Cannot write config: %v", err)
+				return fmt.Errorf("cannot write config: %v", err)
 			}
 
 			cmd.Printf("Unset property %q.\n", args[0])
diff --git a/cmd/registry/cmd/upload/discovery.go b/cmd/registry/cmd/upload/discovery.go
index 2d1caac..7accb64 100644
--- a/cmd/registry/cmd/upload/discovery.go
+++ b/cmd/registry/cmd/upload/discovery.go
@@ -155,7 +155,7 @@ func (task *uploadDiscoveryTask) createAPI(ctx context.Context) error {
 		// Returning this error ends all tasks, which seems appropriate to
 		// handle situations where all might fail due to a common problem
 		// (a missing project or incorrect project-id).
-		return fmt.Errorf("Failed to create %s, %s", task.apiName(), err)
+		return fmt.Errorf("failed to create %s, %s", task.apiName(), err)
 	}
 
 	return nil
diff --git a/cmd/registry/cmd/upload/openapi.go b/cmd/registry/cmd/upload/openapi.go
index 8cc0359..9eeb686 100644
--- a/cmd/registry/cmd/upload/openapi.go
+++ b/cmd/registry/cmd/upload/openapi.go
@@ -205,7 +205,7 @@ func (task *uploadOpenAPITask) createAPI(ctx context.Context) error {
 		// Returning this error ends all tasks, which seems appropriate to
 		// handle situations where all might fail due to a common problem
 		// (a missing project or incorrect project-id).
-		return fmt.Errorf("Failed to create %s, %s", task.apiName(), err)
+		return fmt.Errorf("failed to create %s, %s", task.apiName(), err)
 	}
 
 	return nil
diff --git a/cmd/registry/cmd/upload/protos.go b/cmd/registry/cmd/upload/protos.go
index 653d517..0c095b9 100644
--- a/cmd/registry/cmd/upload/protos.go
+++ b/cmd/registry/cmd/upload/protos.go
@@ -224,7 +224,7 @@ func (task *uploadProtoTask) createAPI(ctx context.Context) error {
 		// Returning this error ends all tasks, which seems appropriate to
 		// handle situations where all might fail due to a common problem
 		// (a missing project or incorrect project-id).
-		return fmt.Errorf("Failed to create %s, %s", task.apiName(), err)
+		return fmt.Errorf("failed to create %s, %s", task.apiName(), err)
 	}
 
 	return nil
diff --git a/cmd/registry/conformance/conformance-task.go b/cmd/registry/conformance/conformance-task.go
index 4f1f48f..ba2a007 100644
--- a/cmd/registry/conformance/conformance-task.go
+++ b/cmd/registry/conformance/conformance-task.go
@@ -159,7 +159,7 @@ func (task *ComputeConformanceTask) invokeLinter(
 		RuleIds:       metadata.rules,
 	})
 	if err != nil {
-		return nil, fmt.Errorf("Failed marshaling linterRequest, Error: %s ", err)
+		return nil, fmt.Errorf("failed marshaling linterRequest, Error: %s ", err)
 	}
 
 	executableName := getLinterBinaryName(metadata.name)
@@ -171,7 +171,7 @@ func (task *ComputeConformanceTask) invokeLinter(
 	// Run the linter.
 	output, err := cmd.Output()
 	if err != nil {
-		return nil, fmt.Errorf("Running the plugin %s return error: %s", executableName, err)
+		return nil, fmt.Errorf("running the plugin %s return error: %s", executableName, err)
 	}
 
 	pluginElapsedTime := time.Since(pluginStartTime)
@@ -181,12 +181,12 @@ func (task *ComputeConformanceTask) invokeLinter(
 	linterResponse := &style.LinterResponse{}
 	err = proto.Unmarshal(output, linterResponse)
 	if err != nil {
-		return nil, fmt.Errorf("Failed unmarshalling LinterResponse (plugins must write log messages to stderr, not stdout): %s", err)
+		return nil, fmt.Errorf("failed unmarshalling LinterResponse (plugins must write log messages to stderr, not stdout): %s", err)
 	}
 
 	// Check if there were any errors in the plugin.
 	if len(linterResponse.GetErrors()) > 0 {
-		return nil, fmt.Errorf("Plugin %s encountered errors: %v", executableName, linterResponse.GetErrors())
+		return nil, fmt.Errorf("plugin %s encountered errors: %v", executableName, linterResponse.GetErrors())
 	}
 
 	return linterResponse, nil
diff --git a/cmd/registry/conformance/linter.go b/cmd/registry/conformance/linter.go
index f0373d5..ff1ca5d 100644
--- a/cmd/registry/conformance/linter.go
+++ b/cmd/registry/conformance/linter.go
@@ -75,7 +75,7 @@ func GenerateLinterMetadata(styleguide *style.StyleGuide) (map[string]*linterMet
 	}
 
 	if len(linterNameToMetadata) == 0 {
-		return nil, fmt.Errorf("Empty linter metadata")
+		return nil, fmt.Errorf("empty linter metadata")
 	}
 	return linterNameToMetadata, nil
 }
diff --git a/cmd/registry/controller/controller.go b/cmd/registry/controller/controller.go
index 857d37f..cc23026 100644
--- a/cmd/registry/controller/controller.go
+++ b/cmd/registry/controller/controller.go
@@ -214,7 +214,7 @@ func generateUpdateActions(
 		if takeAction {
 			cmd, err := generateCommand(generatedResource.Action, targetResource.ResourceName().String())
 			if err != nil {
-				return nil, nil, fmt.Errorf("Cannot generate command: %s", err)
+				return nil, nil, fmt.Errorf("cannot generate command: %s", err)
 			}
 			a := &Action{
 				Command:           cmd,
diff --git a/cmd/registry/patterns/parser.go b/cmd/registry/patterns/parser.go
index 033e6e1..ba0c973 100644
--- a/cmd/registry/patterns/parser.go
+++ b/cmd/registry/patterns/parser.go
@@ -198,7 +198,7 @@ func FullResourceNameFromParent(resourcePattern string, parent string) (Resource
 
 	parsedResourcePattern, err := ParseResourcePattern(resourcePattern)
 	if err != nil {
-		return nil, fmt.Errorf("Invalid target Pattern: %s", err)
+		return nil, fmt.Errorf("invalid target Pattern: %s", err)
 	}
 
 	// Replace the parent pattern in the resourcePattern with the supplied pattern name
diff --git a/cmd/registry/scoring/parser.go b/cmd/registry/scoring/parser.go
index 09f6993..0eb0034 100644
--- a/cmd/registry/scoring/parser.go
+++ b/cmd/registry/scoring/parser.go
@@ -353,7 +353,7 @@ func GenerateCombinedPattern(targetPattern *scoring.ResourcePattern, inputPatter
 
 		return mergedPatternName.String(), mergedFilter, nil
 	default:
-		return "", "", fmt.Errorf("Unsupported pattern in either targetPattern %q or inputPattern %q", targetPatternName.String(), inputPatternName.String())
+		return "", "", fmt.Errorf("unsupported pattern in either targetPattern %q or inputPattern %q", targetPatternName.String(), inputPatternName.String())
 	}
 }
 
@@ -381,5 +381,5 @@ func findCommonPattern(a, b string) (string, error) {
 	if a != "-" && b == "-" {
 		return a, nil
 	}
-	return "", fmt.Errorf("Cannot find common pattern")
+	return "", fmt.Errorf("cannot find common pattern")
 }
diff --git a/pkg/config/config.go b/pkg/config/config.go
index f6b6f98..9bac683 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -32,7 +32,7 @@ import (
 const ActivePointerFilename = "active_config"
 
 var (
-	ErrNoActiveConfiguration = fmt.Errorf("No active configuration.")
+	ErrNoActiveConfiguration = fmt.Errorf("no active configuration")
 
 	// Flags defines Flags that may be bound to a Configuration. Use like:
 	// `cmd.PersistentFlags().AddFlagSet(connection.Flags)`
@@ -40,7 +40,7 @@ var (
 
 	// Directory is $HOME/config/registry
 	Directory             string
-	ErrCannotDeleteActive = fmt.Errorf("Cannot delete active configuration")
+	ErrCannotDeleteActive = fmt.Errorf("cannot delete active configuration")
 	ErrReservedConfigName = fmt.Errorf("%q is reserved", ActivePointerFilename)
 
 	envBindings    = []string{"registry.address", "registry.insecure", "registry.token"}
@@ -217,7 +217,7 @@ func ReadValid(name string) (c Configuration, err error) {
 func Read(name string) (c Configuration, err error) {
 	dir, file := filepath.Split(name)
 	if file == "" {
-		return c, fmt.Errorf("Configuration name cannot be empty.")
+		return c, fmt.Errorf("configuration name cannot be empty")
 	}
 
 	if dir == "" {
diff --git a/pkg/config/configuration.go b/pkg/config/configuration.go
index c5376e7..4790c63 100644
--- a/pkg/config/configuration.go
+++ b/pkg/config/configuration.go
@@ -113,7 +113,7 @@ func (c *Configuration) Unset(k string) error {
 func (c *Configuration) Get(k string) (interface{}, error) {
 	m, err := c.FlatMap()
 	if err != nil {
-		return "", fmt.Errorf("Cannot decode config: %v", err)
+		return "", fmt.Errorf("cannot decode config: %v", err)
 	}
 
 	if !strings.Contains(k, ".") {
diff --git a/pkg/names/common.go b/pkg/names/common.go
index 072bab2..c5b0bbf 100644
--- a/pkg/names/common.go
+++ b/pkg/names/common.go
@@ -38,7 +38,7 @@ var customIdentifier = regexp.MustCompile(`^[a-z0-9-.]+$`)
 
 // validateID returns an error if the provided ID is invalid.
 func validateID(id string) error {
-	if "" == id {
+	if id == "" {
 		return fmt.Errorf("invalid identifier %q: identifier must be nonempty", id)
 	} else if !customIdentifier.MatchString(id) {
 		return fmt.Errorf("invalid identifier %q: must match %q", id, customIdentifier)


Test patch:
diff --git a/cmd/registry/cmd/config/config_test.go b/cmd/registry/cmd/config/config_test.go
index 1f6babc..65e1f4f 100644
--- a/cmd/registry/cmd/config/config_test.go
+++ b/cmd/registry/cmd/config/config_test.go
@@ -38,7 +38,7 @@ func TestNoActiveConfig(t *testing.T) {
 
 	checkErr := func(t *testing.T, err error) {
 		t.Helper()
-		want := fmt.Errorf(`No active configuration. Use 'registry config configurations' to manage.`)
+		want := fmt.Errorf(`no active configuration, use 'registry config configurations' to manage`)
 		if err == nil {
 			t.Errorf("expected error: %s", want)
 		} else if diff := cmp.Diff(want.Error(), err.Error()); diff != "" {
diff --git a/cmd/registry/cmd/config/configurations/configurations_test.go b/cmd/registry/cmd/config/configurations/configurations_test.go
index 66b9a2c..0aed058 100644
--- a/cmd/registry/cmd/config/configurations/configurations_test.go
+++ b/cmd/registry/cmd/config/configurations/configurations_test.go
@@ -159,17 +159,17 @@ properties:
 	cmd = deleteCommand()
 	cmd.SetArgs([]string{"config1"})
 	cmd.SetIn(strings.NewReader("Y\n"))
-	want = "Cannot delete config \"config1\": Cannot delete active configuration."
+	want = "cannot delete config \"config1\": cannot delete active configuration"
 	if err = cmd.Execute(); err == nil || err.Error() != want {
-		t.Errorf("expected error: %s", want)
+		t.Errorf("unexpected error, want: %s, got: %s", want, err.Error())
 	}
 
 	cmd = deleteCommand()
 	cmd.SetArgs([]string{"config2"})
 	cmd.SetIn(strings.NewReader("N\n"))
-	want = "Aborted by user."
+	want = "aborted by user"
 	if err = cmd.Execute(); err == nil || err.Error() != want {
-		t.Errorf("expected error: %s", want)
+		t.Errorf("unexpected error, want: %s, got: %s", want, err.Error())
 	}
 
 	cmd = deleteCommand()