File: main.go

package info (click to toggle)
golang-github-tinylib-msgp 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: makefile: 47
file content (25 lines) | stat: -rw-r--r-- 312 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

//go:generate msgp

type Example struct {
	I int    `msg:"i"`
	S string `msg:"s"`
}

func main() {
	e := Example{
		I: 1,
		S: "2",
	}
	b, err := e.MarshalMsg(nil)
	if err != nil {
		panic(err)
	}

	println("done, len(b):", len(b))
	for i := 0; i < len(b); i++ {
		print(b[i], " ")
	}
	println()
}