Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "bytes"
- "encoding/csv"
- "fmt"
- )
- func main() {
- var records = [][]string{}
- data := `first_name,last_name,username
- Rob,Pike,rob`
- f := bytes.NewReader([]byte(data))
- lines, err := csv.NewReader(f).ReadAll()
- if err != nil {
- panic(err)
- }
- for _, line := range lines {
- records = append(records, line)
- }
- fmt.Println(records)
- }
Add Comment
Please, Sign In to add comment