Add .gitignore
This commit is contained in:
parent
edad47b568
commit
54d958d480
3 changed files with 22 additions and 48 deletions
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
go.work.sum
|
||||
|
||||
# env file
|
||||
.env
|
48
main.go
48
main.go
|
@ -1,48 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
sbhpfv1 "git.zervo.org/FLUX/GoSBHPF/SBHPFv1"
|
||||
)
|
||||
|
||||
func main() {
|
||||
file, err := os.Create("test.bin")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
prop_a := sbhpfv1.Property{
|
||||
Key: "active",
|
||||
Type: sbhpfv1.TypeBool,
|
||||
Value: true,
|
||||
}
|
||||
|
||||
prop_b := sbhpfv1.Property{
|
||||
Key: "level",
|
||||
Type: sbhpfv1.TypeInt16,
|
||||
Value: int16(27),
|
||||
}
|
||||
|
||||
child_node := sbhpfv1.Node{
|
||||
Name: "inventory",
|
||||
}
|
||||
|
||||
node := sbhpfv1.Node{
|
||||
Name: "player",
|
||||
Properties: []sbhpfv1.Property{
|
||||
prop_a,
|
||||
prop_b,
|
||||
},
|
||||
Children: []*sbhpfv1.Node{
|
||||
&child_node,
|
||||
},
|
||||
}
|
||||
|
||||
err = sbhpfv1.SerializeNode(file, &node)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
BIN
test.bin
BIN
test.bin
Binary file not shown.
Loading…
Add table
Reference in a new issue