-
-
Save horlabyc/0d570ce2e512cd16880a80dd9bf7a8d1 to your computer and use it in GitHub Desktop.
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
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