mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-30 20:24:34 +03:00 
			
		
		
		
	chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621)
use errors.New to replace fmt.Errorf with no parameters will much better
This commit is contained in:
		| @@ -157,9 +157,9 @@ func runViewDo(c *cli.Context) error { | ||||
| 	} | ||||
|  | ||||
| 	if len(matchedAssetFiles) == 0 { | ||||
| 		return fmt.Errorf("no files matched the given pattern") | ||||
| 		return errors.New("no files matched the given pattern") | ||||
| 	} else if len(matchedAssetFiles) > 1 { | ||||
| 		return fmt.Errorf("too many files matched the given pattern, try to be more specific") | ||||
| 		return errors.New("too many files matched the given pattern, try to be more specific") | ||||
| 	} | ||||
|  | ||||
| 	data, err := matchedAssetFiles[0].fs.ReadFile(matchedAssetFiles[0].name) | ||||
| @@ -180,7 +180,7 @@ func runExtractDo(c *cli.Context) error { | ||||
| 	} | ||||
|  | ||||
| 	if c.NArg() == 0 { | ||||
| 		return fmt.Errorf("a list of pattern of files to extract is mandatory (e.g. '**' for all)") | ||||
| 		return errors.New("a list of pattern of files to extract is mandatory (e.g. '**' for all)") | ||||
| 	} | ||||
|  | ||||
| 	destdir := "." | ||||
|   | ||||
		Reference in New Issue
	
	Block a user