mirror of
https://github.com/itchyny/mmv.git
synced 2025-12-26 22:24:58 +08:00
avoid fmt.Sprintf in error messages
This commit is contained in:
parent
885b5d6aa0
commit
85ce23caff
1 changed files with 4 additions and 4 deletions
8
mmv.go
8
mmv.go
|
|
@ -64,7 +64,7 @@ type sameSourceError struct {
|
|||
}
|
||||
|
||||
func (err *sameSourceError) Error() string {
|
||||
return fmt.Sprintf("duplicate source: %s", err.path)
|
||||
return "duplicate source: " + err.path
|
||||
}
|
||||
|
||||
type sameDestinationError struct {
|
||||
|
|
@ -72,7 +72,7 @@ type sameDestinationError struct {
|
|||
}
|
||||
|
||||
func (err *sameDestinationError) Error() string {
|
||||
return fmt.Sprintf("duplicate destination: %s", err.path)
|
||||
return "duplicate destination: " + err.path
|
||||
}
|
||||
|
||||
type invalidRenameError struct {
|
||||
|
|
@ -80,7 +80,7 @@ type invalidRenameError struct {
|
|||
}
|
||||
|
||||
func (err *invalidRenameError) Error() string {
|
||||
return fmt.Sprintf("invalid rename: %s, %s", err.src, err.dst)
|
||||
return "invalid rename: " + err.src + ", " + err.dst
|
||||
}
|
||||
|
||||
type temporaryPathError struct {
|
||||
|
|
@ -88,7 +88,7 @@ type temporaryPathError struct {
|
|||
}
|
||||
|
||||
func (err *temporaryPathError) Error() string {
|
||||
return fmt.Sprintf("failed to create a temporary path: %s", err.dir)
|
||||
return "failed to create a temporary path: " + err.dir
|
||||
}
|
||||
|
||||
func buildRenames(files map[string]string) ([]rename, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue