Basic parsing
This commit is contained in:
2
data/BUILD
Normal file
2
data/BUILD
Normal file
@ -0,0 +1,2 @@
|
||||
exports_files(glob(["*.json"]))
|
||||
# exports_files(["Export.Cards.json"])
|
@ -3,6 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
go_library(
|
||||
name = "cmd_lib",
|
||||
srcs = ["main.go"],
|
||||
data = [
|
||||
"//data:Bot.Cards.json",
|
||||
"//data:Export.Cards.json"
|
||||
],
|
||||
importpath = "github.com/squk/lotr/extract/cmd",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
|
@ -13,11 +13,12 @@ func main() {
|
||||
fmt.Println("LOTR CARD PARSE")
|
||||
|
||||
|
||||
// Open our jsonFile
|
||||
jsonFile, err := os.Open("users.json")
|
||||
// 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
|
||||
|
@ -1,4 +1,4 @@
|
||||
package extract
|
||||
package types
|
||||
|
||||
type Card struct {
|
||||
PackCode string `json:"pack_code"`
|
||||
|
Reference in New Issue
Block a user