fix: address review feedback — gofmt NITs and remove unreachable default
- github/client.go: add missing blank line between doRequestWithBody and doJSONRequest - cmd/review-bot/main.go: remove double blank line before findAllOwnReviews - cmd/review-bot/main.go: remove unreachable default case in VCS client init switch (provider is already validated at startup) - cmd/review-bot/main_test.go: remove double blank line before TestHasSharedToken - cmd/review-bot/main_test.go: fix comment alignment (gofmt) - review/persona_test.go: fix comment alignment in table literal (gofmt)
This commit is contained in:
@@ -179,9 +179,6 @@ func main() {
|
||||
ghBaseURL = "https://api.github.com"
|
||||
}
|
||||
client = github.NewClient(*reviewerToken, ghBaseURL)
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "Error: unhandled provider %q\n", *provider)
|
||||
os.Exit(1)
|
||||
}
|
||||
slog.Info("VCS client initialized", "provider", *provider)
|
||||
|
||||
@@ -899,7 +896,6 @@ func extractSentinelName(body string) string {
|
||||
return name
|
||||
}
|
||||
|
||||
|
||||
// findAllOwnReviews returns all non-superseded reviews matching the sentinel.
|
||||
func findAllOwnReviews(reviews []vcs.Review, sentinel string) []vcs.Review {
|
||||
var result []vcs.Review
|
||||
|
||||
@@ -210,7 +210,6 @@ func TestBuildSupersededBodyShortSHA(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func TestHasSharedToken(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
@@ -386,6 +386,7 @@ func (c *Client) doRequestWithBody(ctx context.Context, method, reqURL string, r
|
||||
return c.doRequestCore(ctx, method, reqURL, opts)
|
||||
|
||||
}
|
||||
|
||||
// doJSONRequest performs an HTTP request with a JSON body and returns the response body.
|
||||
// It delegates retry/backoff/429 handling to doRequestWithBody.
|
||||
// This is a general-purpose helper used by any method that needs to send JSON payloads
|
||||
|
||||
Reference in New Issue
Block a user