meh
This commit is contained in:
@ -4,17 +4,36 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/bazelbuild/rules_go/go/tools/bazel"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/squk/lotr/cmd/beornextract/types"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("LOTR CARD PARSE")
|
||||
f, err := bazel.Runfile(".")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = filepath.Walk(f,
|
||||
func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(path, info.Size())
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
||||
// Open our jsonFile
|
||||
jsonFile, err := os.Open("./data/Bot.Cards.json")
|
||||
// jsonFile, err := os.Open("cmd/beornextract/data/Bot.Cards.json")
|
||||
jsonFile, err := bazel.Runfile("cmd/beornextract/data/Bot.Cards.json")
|
||||
// if we os.Open returns an error then handle it
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
Reference in New Issue
Block a user