Skip to content

Commit

Permalink
check io copy error & use fprintf
Browse files Browse the repository at this point in the history
as suggested by golangci-lint
  • Loading branch information
sams96 committed Nov 21, 2023
1 parent f725e83 commit fa643fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions datagen/datagen.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ func main() {
}

f, _ := os.Create(fmt.Sprintf("%s.gz", *outFileName))
io.Copy(f, &buf)
_, err = io.Copy(f, &buf)
if err != nil {
log.Fatal(err)
}

fReadme, _ := os.Create(fmt.Sprintf("%s.txt", *outFileName))
fReadme.WriteString(fmt.Sprintf("%s %s", strings.TrimSuffix(*outFileName, ".go"), "uses data from "+printSlice(prefixSlice(pre, files))))
fmt.Fprintf(fReadme, "%s %s", strings.TrimSuffix(*outFileName, ".go"), "uses data from "+printSlice(prefixSlice(pre, files)))
}

func readInputs(in []string, mergeFileName string) (*geojson.FeatureCollection, error) {
Expand Down

0 comments on commit fa643fe

Please sign in to comment.