Skip to content

Instantly share code, notes, and snippets.

@horlabyc

horlabyc/main.go Secret

Created January 4, 2022 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horlabyc/0d570ce2e512cd16880a80dd9bf7a8d1 to your computer and use it in GitHub Desktop.
Save horlabyc/0d570ce2e512cd16880a80dd9bf7a8d1 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/csv"
"log"
"os"
"strconv"
)
func main() {
// CSV Reader
file, err := os.Open("games.csv")
var gameNames []string
var sales []float64
if err != nil {
log.Fatal(err)
}
reader := csv.NewReader(file)
reader.LazyQuotes = true
records, err := reader.ReadAll()
if err != nil {
log.Fatal(err)
}
gameNames, sales = formatRecords(records)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment