Skip to content

Instantly share code, notes, and snippets.

@horlabyc

horlabyc/main.go Secret

Created January 4, 2022 07:19
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/87cf920f4470eb1c10794aeccccdcd81 to your computer and use it in GitHub Desktop.
Save horlabyc/87cf920f4470eb1c10794aeccccdcd81 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/csv"
"log"
"os"
"sort"
"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)
sortedData := mapData(gameNames, sales)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment