Skip to content

Commit 663c2b7

Browse files
committed
fix error return value of os.WriteFile is not checked
1 parent bf609b2 commit 663c2b7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/pgwatch/main_integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ func TestMain_Integration(t *testing.T) {
4444
// Prepare minimal metrics and sources YAML files
4545
metricsYaml := filepath.Join(tempDir, "metrics.yaml")
4646
sourcesYaml := filepath.Join(tempDir, "sources.yaml")
47-
os.WriteFile(metricsYaml, []byte(`
47+
require.NoError(t, os.WriteFile(metricsYaml, []byte(`
4848
metrics:
4949
test_metric:
5050
sqls:
5151
11: select (extract(epoch from now()) * 1e9)::int8 as epoch_ns, 42 as test_metric
52-
`), 0644)
52+
`), 0644))
5353

5454
pg, err := initTestContainer()
5555
require.NoError(t, err)
@@ -58,14 +58,14 @@ metrics:
5858
t.Log(connStr)
5959
require.NoError(t, err)
6060

61-
os.WriteFile(sourcesYaml, []byte(`
61+
require.NoError(t, os.WriteFile(sourcesYaml, []byte(`
6262
- name: test1
6363
conn_str: `+connStr+`
6464
kind: postgres
6565
is_enabled: true
6666
custom_metrics:
6767
test_metric: 60
68-
`), 0644)
68+
`), 0644))
6969

7070
// Mock Exit to capture exit code
7171
var gotExit int32

0 commit comments

Comments
 (0)