Skip to content

Commit

Permalink
fix: fix ci error in errorcheck.
Browse files Browse the repository at this point in the history
Signed-off-by: Electronic-Waste <2690692950@qq.com>
  • Loading branch information
Electronic-Waste committed Mar 12, 2024
1 parent 2496e94 commit b60e35c
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const (
)

var (
testJsonDataPath = filepath.Join("testdata", "JSON")
testDir = "testdata"
testJsonDataPath = filepath.Join(testDir, "JSON")
testTextDataPath = filepath.Join("testdata", "TEXT")
)

Expand All @@ -56,7 +57,7 @@ func TestCollectObservationLog(t *testing.T) {
if err := generateTEXTTestFiles(); err != nil {
t.Fatal(err)
}
defer deleteTestDirs()
defer os.RemoveAll(testDir)

testCases := map[string]struct {
filePath string
Expand Down Expand Up @@ -337,18 +338,6 @@ func generateTestDirs() error {
return nil
}

func deleteTestDirs() error {
if err := os.RemoveAll(filepath.Dir(testJsonDataPath)); err != nil {
return err
}

if err := os.RemoveAll(filepath.Dir(testTextDataPath)); err != nil {
return err
}

return nil
}

func generateJSONTestFiles() error {
testData := []struct {
fileName string
Expand Down

0 comments on commit b60e35c

Please sign in to comment.