task.gno

0.42 Kb ยท 24 lines
 1package ghverify
 2
 3import (
 4	"bufio"
 5	"bytes"
 6)
 7
 8type verificationTask struct {
 9	gnoAddress   string
10	githubHandle string
11}
12
13// MarshalJSON marshals the task contents to JSON.
14func (t *verificationTask) MarshalJSON() ([]byte, error) {
15	buf := new(bytes.Buffer)
16	w := bufio.NewWriter(buf)
17
18	w.Write(
19		[]byte(`{"gno_address":"` + t.gnoAddress + `","github_handle":"` + t.githubHandle + `"}`),
20	)
21
22	w.Flush()
23	return buf.Bytes(), nil
24}