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:
copilot-swe-agent[bot] 2026-03-24 11:05:52 +00:00
parent 6c11ecd9ab
commit dca59d52b6
113 changed files with 222 additions and 287 deletions

View file

@ -76,6 +76,7 @@ func (md *EnabledDetectorMock) ActionsFeatures() (ActionsFeatures, error) {
type AdvancedIssueSearchDetectorMock struct {
EnabledDetectorMock
searchFeatures SearchFeatures
}

View file

@ -353,6 +353,7 @@ func TestRepositoryFeatures(t *testing.T) {
}
func TestProjectV1Support(t *testing.T) {
t.Parallel()
tests := []struct {
name string
hostname string
@ -421,6 +422,7 @@ func TestProjectV1Support(t *testing.T) {
}
func TestAdvancedIssueSearchSupport(t *testing.T) {
t.Parallel()
withIssueAdvanced := `{"data":{"SearchType":{"enumValues":[{"name":"ISSUE"},{"name":"ISSUE_ADVANCED"},{"name":"REPOSITORY"},{"name":"USER"},{"name":"DISCUSSION"}]}}}`
withoutIssueAdvanced := `{"data":{"SearchType":{"enumValues":[{"name":"ISSUE"},{"name":"REPOSITORY"},{"name":"USER"},{"name":"DISCUSSION"}]}}}`
@ -653,6 +655,7 @@ func TestProjectFeatures(t *testing.T) {
}
func TestReleaseFeatures(t *testing.T) {
t.Parallel()
withImmutableReleaseSupport := `{"data":{"Release":{"fields":[{"name":"author"},{"name":"name"},{"name":"immutable"}]}}}`
withoutImmutableReleaseSupport := `{"data":{"Release":{"fields":[{"name":"author"},{"name":"name"}]}}}`
@ -764,6 +767,7 @@ func TestReleaseFeatures(t *testing.T) {
}
func TestActionsFeatures(t *testing.T) {
t.Parallel()
tests := []struct {
name string
hostname string