Rediscover Go settings only when Go work needs them
This commit is contained in:
@@ -53,13 +53,9 @@ func Check(ctx context.Context, request Request) (Candidate, error) {
|
||||
}
|
||||
if request.AfterValidate != nil {
|
||||
callbackErr := request.AfterValidate(ctx, captured, request.ToolOwner)
|
||||
refreshErr := request.ToolOwner.Refresh(ctx)
|
||||
if callbackErr != nil {
|
||||
return captured, fmt.Errorf("after candidate validation: %w", callbackErr)
|
||||
}
|
||||
if refreshErr != nil {
|
||||
return captured, fmt.Errorf("refresh Go settings after candidate callback: %w", refreshErr)
|
||||
}
|
||||
}
|
||||
if err := Recheck(ctx, captured, ""); err != nil {
|
||||
return captured, err
|
||||
@@ -143,13 +139,9 @@ func Validate(ctx context.Context, request Request, captured Candidate) error {
|
||||
}
|
||||
if request.AdditionalChecks != nil {
|
||||
callbackErr := request.AdditionalChecks(ctx, captured)
|
||||
refreshErr := owner.Refresh(ctx)
|
||||
if callbackErr != nil {
|
||||
return fmt.Errorf("validate candidate %s: %w", captured.Commit, callbackErr)
|
||||
}
|
||||
if refreshErr != nil {
|
||||
return fmt.Errorf("refresh Go settings after additional checks: %w", refreshErr)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user