Fix linting issues: canonicalheader, embeddedstructfieldcheck, iotamixing, makezero, testableexamples, wastedassign, usetesting, tparallel, unconvert, intrange, iface
- canonicalheader: fix cacheTTL header value to canonical form - embeddedstructfieldcheck: move embedded fields before regular fields in 4 structs - iotamixing: split const blocks mixing iota with non-iota constants - makezero: use make([]T, 0, n) instead of make([]T, n) before appending - testableexamples: add missing Output: comment to ExampleOption_UnwrapOrZero - wastedassign: remove wasted initial assignments in 4 locations - usetesting: replace os.MkdirTemp/os.Setenv with t.TempDir/t.Setenv in tests - tparallel: add t.Parallel() to 8 top-level test functions - unconvert: remove 16 unnecessary type conversions - intrange: convert 3 for loops to use integer range syntax - iface: consolidate identical EditPrompter and Prompt interfaces via type alias Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
6c11ecd9ab
commit
dca59d52b6
113 changed files with 222 additions and 287 deletions
|
|
@ -19,7 +19,7 @@ const (
|
|||
apiVersion = "X-GitHub-Api-Version"
|
||||
apiVersionValue = "2022-11-28"
|
||||
authorization = "Authorization"
|
||||
cacheTTL = "X-GH-CACHE-TTL"
|
||||
cacheTTL = "X-Gh-Cache-Ttl"
|
||||
graphqlFeatures = "GraphQL-Features"
|
||||
features = "merge_queue"
|
||||
userAgent = "User-Agent"
|
||||
|
|
@ -46,6 +46,7 @@ type GraphQLError struct {
|
|||
|
||||
type HTTPError struct {
|
||||
*ghAPI.HTTPError
|
||||
|
||||
scopesSuggestion string
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ func TestNewHTTPClient(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
req, err := http.NewRequest("GET", ts.URL, nil)
|
||||
req.Header.Set("time-zone", "Europe/Amsterdam")
|
||||
req.Header.Set("Time-Zone", "Europe/Amsterdam")
|
||||
req.Host = tt.host
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
|
|||
|
|
@ -387,7 +387,6 @@ func (pr *PullRequest) ChecksStatus() PullRequestChecksStatus {
|
|||
} else {
|
||||
summary.Pending++
|
||||
}
|
||||
|
||||
} else { // c.TypeName == StatusContext
|
||||
switch parseCheckStatusFromStatusState(c.State) {
|
||||
case passing:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue