github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/gnoland/ghverify/task.gno (about)

     1  package ghverify
     2  
     3  import (
     4  	"bufio"
     5  	"bytes"
     6  )
     7  
     8  type verificationTask struct {
     9  	gnoAddress   string
    10  	githubHandle string
    11  }
    12  
    13  // MarshalJSON marshals the task contents to JSON.
    14  func (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  }