summaryrefslogtreecommitdiffstats
path: root/cmd/test
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/test')
-rw-r--r--cmd/test/main.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/cmd/test/main.go b/cmd/test/main.go
new file mode 100644
index 0000000..e580b63
--- /dev/null
+++ b/cmd/test/main.go
@@ -0,0 +1,34 @@
+package main
+
+import (
+ "fmt"
+ "time"
+
+ "git.sr.ht/~rctt/solecd/core"
+)
+
+func main() {
+ in := core.Test{
+ Num1: 1,
+ Time1: time.Now(),
+ Str1: "test string",
+ Num2: 2,
+ Bin1: []byte{0x01, 0x02, 0x03},
+ Num3: 3,
+ Str2: "こんにちは",
+ Num4: 4,
+ }
+
+ data, err := core.Encode(in)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("% X\n", data)
+ out, err := core.Decode(data)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("%+v\n", out)
+}