mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Close the file after reading in verifydependencies#main
This commit is contained in:
		@@ -72,10 +72,12 @@ func main() {
 | 
			
		||||
 | 
			
		||||
	for _, dep := range externalDeps.Dependencies {
 | 
			
		||||
		for _, refPath := range dep.RefPaths {
 | 
			
		||||
			func() {
 | 
			
		||||
				file, err := os.Open(refPath.Path)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					log.Fatalf("error opening file %v : %v", refPath.Path, err)
 | 
			
		||||
				}
 | 
			
		||||
				defer file.Close()
 | 
			
		||||
				matcher := regexp.MustCompile(refPath.Match)
 | 
			
		||||
				depFileScanner := bufio.NewScanner(file)
 | 
			
		||||
				var found bool
 | 
			
		||||
@@ -89,6 +91,7 @@ func main() {
 | 
			
		||||
				if !found {
 | 
			
		||||
					pathsToUpdate = append(pathsToUpdate, refPath.Path)
 | 
			
		||||
				}
 | 
			
		||||
			}()
 | 
			
		||||
		}
 | 
			
		||||
		if len(pathsToUpdate) > 0 {
 | 
			
		||||
			log.Fatalf(mismatchErrorMessage, externalDepsFilePath, dep.Name, dep.Version, strings.Join(pathsToUpdate, "\n"), dep.Name, externalDepsFilePath)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user