stuff
This commit is contained in:
31
cmd/beornextract/main.go
Normal file
31
cmd/beornextract/main.go
Normal file
@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"github.com/squk/lotr/extract/types"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("LOTR CARD PARSE")
|
||||
|
||||
|
||||
// Open our jsonFile
|
||||
jsonFile, err := os.Open("./data/Bot.Cards.json")
|
||||
// if we os.Open returns an error then handle it
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
fmt.Println("Successfully Opened users.json")
|
||||
// defer the closing of our jsonFile so that we can parse it later on
|
||||
defer jsonFile.Close()
|
||||
|
||||
byteValue, _ := ioutil.ReadAll(jsonFile)
|
||||
c := []types.HallOfBeornCard{}
|
||||
json.Unmarshal(byteValue, &c)
|
||||
spew.Dump(c)
|
||||
}
|
Reference in New Issue
Block a user