Last active
June 15, 2019 15:59
-
-
Save mottet-dev/0d95aa2ce982b966b46c941f49032bc9 to your computer and use it in GitHub Desktop.
CSV Writer - Go Colly Advanced
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
fileName := "amazon_products.csv" | |
file, err := os.Create(fileName) | |
if err != nil { | |
log.Fatalf("Could not create %s", fileName) | |
} | |
defer file.Close() | |
writer := csv.NewWriter(file) | |
defer writer.Flush() | |
writer.Write([]string{"Product Name", "Stars", "Price"}) | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment