Skip to content

Commit

Permalink
metrics/vocabulary: err check before Close() (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Feb 29, 2024
1 parent f702249 commit bf7795e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metrics/vocabulary/vocabulary.go
Expand Up @@ -43,10 +43,11 @@ func WriteCSV(v *metrics.Vocabulary, filename string) error {
filename = "vocabulary-operation.csv"
}
f4, ferror := os.Create(filename)
defer f4.Close()
if ferror != nil {
return ferror
}
defer f4.Close()

for _, s := range v.Schemas {
temp := fmt.Sprintf("%s,\"%s\",%d\n", "schemas", s.Word, int(s.Count))
f4.WriteString(temp)
Expand Down

0 comments on commit bf7795e

Please sign in to comment.