Skip to content

Commit dd7660e

Browse files
authored
testutil: remove unnecessary formatting on err (#10)
* testutil: remove unnecessary formatting on err Error can contain stuff like %s and then that gets interpreted as a format string command. That's really not the intention here. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com> * .github/workflows: try fixing Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com> --------- Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
1 parent 89a1c45 commit dd7660e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/go.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ jobs:
2020
with:
2121
go-version: 1.19.x
2222

23-
- uses: actions/cache@v1
23+
- uses: actions/cache@v4
2424
with:
25-
path: ~/go/pkg/mod
25+
path: |
26+
~/.cache/go-build
27+
~/go/pkg/mod
2628
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
2731
2832
- name: Linting & vetting.
2933
env:

testutil/testutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func Ok(tb testing.TB, err error, v ...interface{}) {
5454
if len(v) > 0 {
5555
msg = fmt.Sprintf(v[0].(string), v[1:]...)
5656
}
57-
tb.Fatalf("\033[31m%s:%d: \"%s\"\n\n unexpected error: %s\033[39m\n\n", filepath.Base(file), line, withLimitf(msg), withLimitf(err.Error()))
57+
tb.Fatalf("\033[31m%s:%d: \"%s\"\n\n unexpected error: %s\033[39m\n\n", filepath.Base(file), line, withLimitf(msg), err.Error())
5858
}
5959

6060
// NotOk fails the test if an err is nil.

0 commit comments

Comments
 (0)