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
|
|
@ -175,7 +175,7 @@ func listRun(opts *ListOptions) error {
|
|||
tp.AddField(run.Title(), tableprinter.WithColor(cs.Bold))
|
||||
tp.AddField(run.WorkflowName())
|
||||
tp.AddField(run.HeadBranch, tableprinter.WithColor(cs.Bold))
|
||||
tp.AddField(string(run.Event))
|
||||
tp.AddField(run.Event)
|
||||
tp.AddField(fmt.Sprintf("%d", run.ID), tableprinter.WithColor(cs.Cyan))
|
||||
tp.AddField(run.Duration(opts.now).String())
|
||||
tp.AddTimeField(opts.now, run.StartedTime(), cs.Muted)
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ func TestNewCmdRerun(t *testing.T) {
|
|||
assert.Equal(t, tt.wants.Prompt, gotOpts.Prompt)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestRerun(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ func (c RunLogCache) Create(key string, content io.Reader) error {
|
|||
|
||||
if _, err := io.Copy(out, content); err != nil {
|
||||
return fmt.Errorf("writing cache entry: %v", err)
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
@ -349,7 +348,7 @@ func runView(opts *ViewOptions) error {
|
|||
|
||||
var artifacts []shared.Artifact
|
||||
if selectedJob == nil {
|
||||
artifacts, err = shared.ListArtifacts(httpClient, repo, strconv.FormatInt(int64(run.ID), 10))
|
||||
artifacts, err = shared.ListArtifacts(httpClient, repo, strconv.FormatInt(run.ID, 10))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get artifacts: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue