enable misspell
Finds commonly misspelled English words. Signed-off-by: Kai Xia <kaix+github@fastmail.com>
This commit is contained in:
parent
1fab1967d2
commit
c5e8e19f54
4 changed files with 8 additions and 9 deletions
|
|
@ -47,7 +47,6 @@ linters:
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- lll
|
- lll
|
||||||
- maintidx
|
- maintidx
|
||||||
- misspell
|
|
||||||
- mnd
|
- mnd
|
||||||
- modernize
|
- modernize
|
||||||
- nakedret
|
- nakedret
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ func LoginBrowser(cfg OAuthProviderConfig) (*AuthCredential, error) {
|
||||||
return exchangeCodeForTokens(cfg, result.code, pkce.CodeVerifier, redirectURI)
|
return exchangeCodeForTokens(cfg, result.code, pkce.CodeVerifier, redirectURI)
|
||||||
case manualInput := <-manualCh:
|
case manualInput := <-manualCh:
|
||||||
if manualInput == "" {
|
if manualInput == "" {
|
||||||
return nil, fmt.Errorf("manual input cancelled")
|
return nil, fmt.Errorf("manual input canceled")
|
||||||
}
|
}
|
||||||
// Extract code from URL if it's a full URL
|
// Extract code from URL if it's a full URL
|
||||||
code := manualInput
|
code := manualInput
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ func (c *OneBotChannel) sendAPIRequest(action string, params any, timeout time.D
|
||||||
case <-time.After(timeout):
|
case <-time.After(timeout):
|
||||||
return nil, fmt.Errorf("API request %s timed out after %v", action, timeout)
|
return nil, fmt.Errorf("API request %s timed out after %v", action, timeout)
|
||||||
case <-c.ctx.Done():
|
case <-c.ctx.Done():
|
||||||
return nil, fmt.Errorf("context cancelled")
|
return nil, fmt.Errorf("context canceled")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,12 +132,12 @@ After completing the task, provide a clear summary of what was done.`
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if context is already cancelled before starting
|
// Check if context is already canceled before starting
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
sm.mu.Lock()
|
sm.mu.Lock()
|
||||||
task.Status = "cancelled"
|
task.Status = "canceled"
|
||||||
task.Result = "Task cancelled before execution"
|
task.Result = "Task canceled before execution"
|
||||||
sm.mu.Unlock()
|
sm.mu.Unlock()
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
|
|
@ -185,10 +185,10 @@ After completing the task, provide a clear summary of what was done.`
|
||||||
if err != nil {
|
if err != nil {
|
||||||
task.Status = "failed"
|
task.Status = "failed"
|
||||||
task.Result = fmt.Sprintf("Error: %v", err)
|
task.Result = fmt.Sprintf("Error: %v", err)
|
||||||
// Check if it was cancelled
|
// Check if it was canceled
|
||||||
if ctx.Err() != nil {
|
if ctx.Err() != nil {
|
||||||
task.Status = "cancelled"
|
task.Status = "canceled"
|
||||||
task.Result = "Task cancelled during execution"
|
task.Result = "Task canceled during execution"
|
||||||
}
|
}
|
||||||
result = &ToolResult{
|
result = &ToolResult{
|
||||||
ForLLM: task.Result,
|
ForLLM: task.Result,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue