@@ -40,10 +40,10 @@ import (
4040func TestLookForResults_FanOutAndWait (t * testing.T ) {
4141 for _ , c := range []struct {
4242 desc string
43- results []SidecarLogResult
43+ Results []SidecarLogResult `json:"result"`
4444 }{{
4545 desc : "multiple results" ,
46- results : []SidecarLogResult {{
46+ Results : []SidecarLogResult {{
4747 Name : "foo" ,
4848 Value : "bar" ,
4949 Type : "task" ,
@@ -57,7 +57,7 @@ func TestLookForResults_FanOutAndWait(t *testing.T) {
5757 dir := t .TempDir ()
5858 resultNames := []string {}
5959 wantResults := []byte {}
60- for _ , result := range c .results {
60+ for _ , result := range c .Results {
6161 createResult (t , dir , result .Name , result .Value )
6262 resultNames = append (resultNames , result .Name )
6363 encodedResult , err := json .Marshal (result )
@@ -363,7 +363,7 @@ func TestParseResults_InvalidType(t *testing.T) {
363363 }
364364 for _ , plog := range podLogs {
365365 _ , err := parseResults ([]byte (plog ), 4096 )
366- wantErr := fmt . Errorf ("invalid sidecar result type not task or step. Must be task or step" )
366+ wantErr := errors . New ("invalid sidecar result type not task or step. Must be task or step" )
367367 if d := cmp .Diff (wantErr .Error (), err .Error ()); d != "" {
368368 t .Fatal (diff .PrintWantGot (d ))
369369 }
@@ -468,7 +468,7 @@ func TestExtractStepAndResultFromSidecarResultName(t *testing.T) {
468468func TestExtractStepAndResultFromSidecarResultName_Error (t * testing.T ) {
469469 sidecarResultName := "step-foo-resultName"
470470 _ , _ , err := ExtractStepAndResultFromSidecarResultName (sidecarResultName )
471- wantErr := fmt . Errorf ("invalid string step-foo-resultName : expected somtthing that looks like <stepName>.<resultName>" )
471+ wantErr := errors . New ("invalid string step-foo-resultName : expected somtthing that looks like <stepName>.<resultName>" )
472472 if d := cmp .Diff (wantErr .Error (), err .Error ()); d != "" {
473473 t .Fatal (diff .PrintWantGot (d ))
474474 }
@@ -477,9 +477,9 @@ func TestExtractStepAndResultFromSidecarResultName_Error(t *testing.T) {
477477func createStepResult (t * testing.T , dir , stepName , resultName , resultValue string ) {
478478 t .Helper ()
479479 resultDir := filepath .Join (dir , stepName , "results" )
480- _ = os .MkdirAll (resultDir , 0755 )
480+ _ = os .MkdirAll (resultDir , 0o755 )
481481 resultFile := filepath .Join (resultDir , resultName )
482- err := os .WriteFile (resultFile , []byte (resultValue ), 0644 )
482+ err := os .WriteFile (resultFile , []byte (resultValue ), 0o644 )
483483 if err != nil {
484484 t .Fatal (err )
485485 }
@@ -488,7 +488,7 @@ func createStepResult(t *testing.T, dir, stepName, resultName, resultValue strin
488488func createResult (t * testing.T , dir string , resultName string , resultValue string ) {
489489 t .Helper ()
490490 resultFile := filepath .Join (dir , resultName )
491- err := os .WriteFile (resultFile , []byte (resultValue ), 0644 )
491+ err := os .WriteFile (resultFile , []byte (resultValue ), 0o644 )
492492 if err != nil {
493493 t .Fatal (err )
494494 }
@@ -497,12 +497,12 @@ func createResult(t *testing.T, dir string, resultName string, resultValue strin
497497func createRun (t * testing.T , dir string , causeErr bool ) {
498498 t .Helper ()
499499 stepFile := filepath .Join (dir , "1" )
500- _ = os .Mkdir (stepFile , 0755 )
500+ _ = os .Mkdir (stepFile , 0o755 )
501501 stepFile = filepath .Join (stepFile , "out" )
502502 if causeErr {
503503 stepFile += ".err"
504504 }
505- err := os .WriteFile (stepFile , []byte ("" ), 0644 )
505+ err := os .WriteFile (stepFile , []byte ("" ), 0o644 )
506506 if err != nil {
507507 t .Fatal (err )
508508 }
0 commit comments