feat(ci): fix linter complaints
This commit is contained in:
parent
02d022da54
commit
5180599583
2 changed files with 11 additions and 4 deletions
|
|
@ -274,13 +274,16 @@ func handleResult(result GitOperationResult, stats *GitStats) {
|
||||||
logger.Print("Successfully pulled: "+result.RepoName, nil)
|
logger.Print("Successfully pulled: "+result.RepoName, nil)
|
||||||
|
|
||||||
case "error":
|
case "error":
|
||||||
if result.ErrorType == "unstaged" {
|
switch result.ErrorType {
|
||||||
|
case "unstaged":
|
||||||
stats.IncrementCounter("unstaged", result.RepoName)
|
stats.IncrementCounter("unstaged", result.RepoName)
|
||||||
logger.Print("Found unstaged changes in: "+result.RepoName, nil)
|
logger.Print("Found unstaged changes in: "+result.RepoName, nil)
|
||||||
} else if result.ErrorType == "uncommitted" {
|
|
||||||
|
case "uncommitted":
|
||||||
stats.IncrementCounter("uncommitted", result.RepoName)
|
stats.IncrementCounter("uncommitted", result.RepoName)
|
||||||
logger.Print("Found uncommitted changes in: "+result.RepoName, nil)
|
logger.Print("Found uncommitted changes in: "+result.RepoName, nil)
|
||||||
} else {
|
|
||||||
|
default:
|
||||||
stats.IncrementCounter("error", "")
|
stats.IncrementCounter("error", "")
|
||||||
logger.Print("ERROR processing "+result.RepoName+": "+result.Error.Error(), nil)
|
logger.Print("ERROR processing "+result.RepoName+": "+result.Error.Error(), nil)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,11 @@ func (c *GiteaClient) ValidateConnection(ctx context.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("making validation request: %w", err)
|
return fmt.Errorf("making validation request: %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer func() {
|
||||||
|
if err := resp.Body.Close(); err != nil {
|
||||||
|
logger.Print("failed to close response body: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if resp.StatusCode == http.StatusUnauthorized {
|
if resp.StatusCode == http.StatusUnauthorized {
|
||||||
return fmt.Errorf("invalid or expired token")
|
return fmt.Errorf("invalid or expired token")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue