44 "encoding/json"
55 "fmt"
66 "io"
7- "io/ioutil"
87 "strings"
98 "testing"
109
@@ -32,7 +31,7 @@ type mockProgram struct {
3231// Output returns responses from the remote credentials helper.
3332// It mocks those responses based in the input in the mock.
3433func (m * mockProgram ) Output () ([]byte , error ) {
35- in , err := ioutil .ReadAll (m .input )
34+ in , err := io .ReadAll (m .input )
3635 if err != nil {
3736 return nil , err
3837 }
@@ -108,8 +107,8 @@ func ExampleStore() {
108107
109108func TestStore (t * testing.T ) {
110109 valid := []credentials.Credentials {
111- {validServerAddress , "foo" , "bar" },
112- {validServerAddress2 , "<token>" , "abcd1234" },
110+ {ServerURL : validServerAddress , Username : "foo" , Secret : "bar" },
111+ {ServerURL : validServerAddress2 , Username : "<token>" , Secret : "abcd1234" },
113112 }
114113
115114 for _ , v := range valid {
@@ -119,7 +118,7 @@ func TestStore(t *testing.T) {
119118 }
120119
121120 invalid := []credentials.Credentials {
122- {invalidServerAddress , "foo" , "bar" },
121+ {ServerURL : invalidServerAddress , Username : "foo" , Secret : "bar" },
123122 }
124123
125124 for _ , v := range invalid {
@@ -142,8 +141,8 @@ func ExampleGet() {
142141
143142func TestGet (t * testing.T ) {
144143 valid := []credentials.Credentials {
145- {validServerAddress , "foo" , "bar" },
146- {validServerAddress2 , "<token>" , "abcd1234" },
144+ {ServerURL : validServerAddress , Username : "foo" , Secret : "bar" },
145+ {ServerURL : validServerAddress2 , Username : "<token>" , Secret : "abcd1234" },
147146 }
148147
149148 for _ , v := range valid {
0 commit comments