Skip to content

Commit b1738d9

Browse files
sethvargojefferai
authored andcommitted
Fix broken formatting directives (#242)
It looks like Go 1.10 fails these. This makes the build green again.
1 parent 23c074d commit b1738d9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

hcl/ast/ast_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func TestWalkEquality(t *testing.T) {
137137
}
138138

139139
if len(newNode.Items) != 2 {
140-
t.Error("expected newNode length 2, got: %d", len(newNode.Items))
140+
t.Errorf("expected newNode length 2, got: %d", len(newNode.Items))
141141
}
142142

143143
expected := []string{
@@ -147,7 +147,7 @@ func TestWalkEquality(t *testing.T) {
147147

148148
for i, item := range newNode.Items {
149149
if len(item.Keys) != 1 {
150-
t.Error("expected keys newNode length 1, got: %d", len(item.Keys))
150+
t.Errorf("expected keys newNode length 1, got: %d", len(item.Keys))
151151
}
152152

153153
if item.Keys[0].Token.Text != expected[i] {

hcl/fmtcmd/fmtcmd_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestIsValidFile(t *testing.T) {
4646
}
4747

4848
if res := isValidFile(file, fixtureExtensions); res != tc.Expected {
49-
t.Errorf("want: %b, got: %b", tc.Expected, res)
49+
t.Errorf("want: %t, got: %t", tc.Expected, res)
5050
}
5151
}
5252
}
@@ -86,7 +86,7 @@ func TestRunMultiplePaths(t *testing.T) {
8686
t.Errorf("unexpected error: %s", err)
8787
}
8888
if stdout.String() != expectedOut.String() {
89-
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout)
89+
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String())
9090
}
9191
}
9292

@@ -132,7 +132,7 @@ func TestRunSubDirectories(t *testing.T) {
132132
t.Errorf("unexpected error: %s", err)
133133
}
134134
if stdout.String() != expectedOut.String() {
135-
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout)
135+
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String())
136136
}
137137
}
138138

@@ -161,7 +161,7 @@ func TestRunStdin(t *testing.T) {
161161
t.Errorf("unexpected error: %s", err)
162162
}
163163
if !bytes.Equal(stdout.Bytes(), expectedOut.Bytes()) {
164-
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout)
164+
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String())
165165
}
166166
}
167167

@@ -242,7 +242,7 @@ func TestRunNoOptions(t *testing.T) {
242242
t.Errorf("unexpected error: %s", err)
243243
}
244244
if stdout.String() != expectedOut.String() {
245-
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout)
245+
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String())
246246
}
247247
}
248248

@@ -274,7 +274,7 @@ func TestRunList(t *testing.T) {
274274
t.Errorf("unexpected error: %s", err)
275275
}
276276
if stdout.String() != expectedOut.String() {
277-
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout)
277+
t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String())
278278
}
279279
}
280280

0 commit comments

Comments
 (0)