github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/demo/boards/z_0_a_filetest.gno (about)

     1  // PKGPATH: gno.land/r/boards_test
     2  package boards_test
     3  
     4  import (
     5  	"gno.land/r/demo/boards"
     6  )
     7  
     8  var bid boards.BoardID
     9  
    10  func init() {
    11  	bid = boards.CreateBoard("test_board")
    12  	boards.CreateThread(bid, "First Post (title)", "Body of the first post. (body)")
    13  	pid := boards.CreateThread(bid, "Second Post (title)", "Body of the second post. (body)")
    14  	boards.CreateReply(bid, pid, pid, "Reply of the second post")
    15  }
    16  
    17  func main() {
    18  	println(boards.Render("test_board"))
    19  }
    20  
    21  // Error:
    22  // unauthorized