Basic parsing
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user