Rediscover Go settings only when Go work needs them

This commit is contained in:
2026-10-10 14:11:48 +00:00
parent 9333573cd8
commit c8eb64adec
8 changed files with 104 additions and 48 deletions

View File

@@ -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
}