1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package main import ( "strconv" "fmt" "os" "github.com/kch42/gonbt/nbt" ) func main() { tag, name, err := nbt.ReadNamedTag(os.Stdin) if err != nil { fmt.Fprintf(os.Stderr, "Could not read NBT data: %s", err) os.Exit(1) } fmt.Printf("Tag Name:\n%s\n\nData:\n%s\n", strconv.Quote(name), tag) }