Skip to content

Commit

Permalink
Fix capitalization of error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tpdownes committed Jun 20, 2023
1 parent 9e7ab91 commit 1df86bf
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/modulereader/resreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func GetModuleInfo(source string, kind string) (ModuleInfo, error) {
modPath = source

default:
return ModuleInfo{}, fmt.Errorf("Source is not valid: %s", source)
return ModuleInfo{}, fmt.Errorf("source is not valid: %s", source)
}

reader := Factory(kind)
Expand Down
6 changes: 3 additions & 3 deletions pkg/modulereader/resreader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (s *MySuite) TestGetModuleInfo_Embedded(c *C) {
// Invalid: Unsupported Module Source
badSource := "gcs::https://www.googleapis.com/storage/v1/GoogleCloudPlatform/hpc-toolkit/modules"
moduleInfo, err = GetModuleInfo(badSource, tfKindString)
expectedErr = "Source is not valid: .*"
expectedErr = "source is not valid: .*"
c.Assert(err, ErrorMatches, expectedErr)
}

Expand All @@ -127,7 +127,7 @@ func (s *MySuite) TestGetModuleInfo_Git(c *C) {
// Invalid: Unsupported Module Source
badSource := "gcs::https://www.googleapis.com/storage/v1/GoogleCloudPlatform/hpc-toolkit/modules"
_, err = GetModuleInfo(badSource, tfKindString)
expectedErr = "Source is not valid: .*"
expectedErr = "source is not valid: .*"
c.Assert(err, ErrorMatches, expectedErr)
}

Expand All @@ -148,7 +148,7 @@ func (s *MySuite) TestGetModuleInfo_Local(c *C) {
// Invalid: Unsupported Module Source
badSource := "gcs::https://www.googleapis.com/storage/v1/GoogleCloudPlatform/hpc-toolkit/modules"
moduleInfo, err = GetModuleInfo(badSource, tfKindString)
expectedErr = "Source is not valid: .*"
expectedErr = "source is not valid: .*"
c.Assert(err, ErrorMatches, expectedErr)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sourcereader/embedded.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (r EmbeddedSourceReader) GetModule(modPath string, copyPath string) error {
return fmt.Errorf("embedded file system is not initialized")
}
if !IsEmbeddedPath(modPath) {
return fmt.Errorf("Source is not valid: %s", modPath)
return fmt.Errorf("source is not valid: %s", modPath)
}

modDir, err := copyFSToTempDir(ModuleFS, modPath)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sourcereader/embedded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (s *MySuite) TestGetModule_Embedded(c *C) {
// Invalid: Unsupported Module Source by EmbeddedSourceReader
badSource := "gcs::https://www.googleapis.com/storage/v1/GoogleCloudPlatform/hpc-toolkit/modules"
err = reader.GetModule(badSource, dest)
expectedErr = "Source is not valid: .*"
expectedErr = "source is not valid: .*"
c.Assert(err, ErrorMatches, expectedErr)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sourcereader/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func copyGitModules(srcPath string, destPath string) error {
// GetModule copies the git source to a provided destination (the deployment directory)
func (r GitSourceReader) GetModule(modPath string, copyPath string) error {
if !IsGitPath(modPath) {
return fmt.Errorf("Source is not valid: %s", modPath)
return fmt.Errorf("source is not valid: %s", modPath)
}

modDir, err := ioutil.TempDir("", "git-module-*")
Expand Down
2 changes: 1 addition & 1 deletion pkg/sourcereader/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ func (s *MySuite) TestGetModule_Git(c *C) {
// Invalid: Unsupported Module Source
badSource := "gcs::https://www.googleapis.com/storage/v1/GoogleCloudPlatform/hpc-toolkit/modules"
err = reader.GetModule(badSource, tfKindString)
expectedErr = "Source is not valid: .*"
expectedErr = "source is not valid: .*"
c.Assert(err, ErrorMatches, expectedErr)
}
2 changes: 1 addition & 1 deletion pkg/sourcereader/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type LocalSourceReader struct{}
// GetModule copies the local source to a provided destination (the deployment directory)
func (r LocalSourceReader) GetModule(modPath string, copyPath string) error {
if !IsLocalPath(modPath) {
return fmt.Errorf("Source is not valid: %s", modPath)
return fmt.Errorf("source is not valid: %s", modPath)
}

if _, err := os.Stat(modPath); os.IsNotExist(err) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sourcereader/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ func (s *MySuite) TestGetModule_Local(c *C) {
// Invalid: Unsupported Module Source by LocalSourceReader
badSource := "gcs::https://www.googleapis.com/storage/v1/GoogleCloudPlatform/hpc-toolkit/modules"
err = reader.GetModule(badSource, dest)
expectedErr = "Source is not valid: .*"
expectedErr = "source is not valid: .*"
c.Assert(err, ErrorMatches, expectedErr)
}

0 comments on commit 1df86bf

Please sign in to comment.