mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	enforce explanation for necessary nolints and fix bugs (#34883)
Follows up https://github.com/go-gitea/gitea/pull/34851 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -295,16 +295,14 @@ func collectAssetFilesByPattern(c *cli.Command, globs []glob.Glob, path string, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func compileCollectPatterns(args []string) ([]glob.Glob, error) { | ||||
| func compileCollectPatterns(args []string) (_ []glob.Glob, err error) { | ||||
| 	if len(args) == 0 { | ||||
| 		args = []string{"**"} | ||||
| 	} | ||||
| 	pat := make([]glob.Glob, len(args)) | ||||
| 	for i := range args { | ||||
| 		if g, err := glob.Compile(args[i], '/'); err != nil { | ||||
| 			return nil, fmt.Errorf("'%s': Invalid glob pattern: %w", args[i], err) | ||||
| 		} else { //nolint:revive | ||||
| 			pat[i] = g | ||||
| 		if pat[i], err = glob.Compile(args[i], '/'); err != nil { | ||||
| 			return nil, fmt.Errorf("invalid glob patterh %q: %w", args[i], err) | ||||
| 		} | ||||
| 	} | ||||
| 	return pat, nil | ||||
|   | ||||
		Reference in New Issue
	
	Block a user