From 7944c654939e14a30d5b7b72cf2ebd8ab7240df0 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 2 Jul 2020 08:03:41 +0200 Subject: [PATCH] Example #18: CBOR and basic data types --- lesson7/marshalling/18_cbor_basic_types.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lesson7/marshalling/18_cbor_basic_types.go diff --git a/lesson7/marshalling/18_cbor_basic_types.go b/lesson7/marshalling/18_cbor_basic_types.go new file mode 100644 index 0000000..ab6ff84 --- /dev/null +++ b/lesson7/marshalling/18_cbor_basic_types.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "github.com/fxamacker/cbor/v2" +) + +func main() { + var a bool = true + + var jsonOutput []byte + + cborOutput, _ = cbor.Marshal(a) + fmt.Println(string(cborOutput)) +}