all: Tweak error creation (#6391)
- In the few places where we wrap errors, use the new Go 1.13 "%w" construction instead of %s or %v. - Where we create errors with constant strings, consistently use errors.New and not fmt.Errorf. - Remove capitalization from errors in the few places where we had that.
This commit is contained in:
@@ -295,11 +295,11 @@ func (cfg *Configuration) clean() error {
|
||||
}
|
||||
|
||||
if folder.Path == "" {
|
||||
return fmt.Errorf("folder %q: %v", folder.ID, errFolderPathEmpty)
|
||||
return fmt.Errorf("folder %q: %w", folder.ID, errFolderPathEmpty)
|
||||
}
|
||||
|
||||
if _, ok := existingFolders[folder.ID]; ok {
|
||||
return fmt.Errorf("folder %q: %v", folder.ID, errFolderIDDuplicate)
|
||||
return fmt.Errorf("folder %q: %w", folder.ID, errFolderIDDuplicate)
|
||||
}
|
||||
|
||||
existingFolders[folder.ID] = folder
|
||||
|
||||
Reference in New Issue
Block a user