mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	Add comment to document the purpose behind the non-standard handling of the error
Signed-off-by: Talon Bowler <talon.bowler@docker.com>
This commit is contained in:
		@@ -878,6 +878,12 @@ func printResult(f *controllerapi.PrintFunc, res map[string]string) error {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if lintResults.Error != nil {
 | 
							if lintResults.Error != nil {
 | 
				
			||||||
 | 
								// Print the error message and the source
 | 
				
			||||||
 | 
								// Normally, we would use `errdefs.WithSource` to attach the source to the
 | 
				
			||||||
 | 
								// error and let the error be printed by the handling that's already in place,
 | 
				
			||||||
 | 
								// but here we want to print the error in a way that's consistent with how
 | 
				
			||||||
 | 
								// the lint warnings are printed via the `lint.PrintLintViolations` function,
 | 
				
			||||||
 | 
								// which differs from the default error printing.
 | 
				
			||||||
			fmt.Println()
 | 
								fmt.Println()
 | 
				
			||||||
			lintBuf := bytes.NewBuffer([]byte(lintResults.Error.Message + "\n"))
 | 
								lintBuf := bytes.NewBuffer([]byte(lintResults.Error.Message + "\n"))
 | 
				
			||||||
			sourceInfo := lintResults.Sources[lintResults.Error.Location.SourceIndex]
 | 
								sourceInfo := lintResults.Sources[lintResults.Error.Location.SourceIndex]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user