Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

render.gno

0.29 Kb · 21 lines
 1package sapin
 2
 3import "strconv"
 4
 5const defaultSize int = 3
 6
 7func Render(path string) string {
 8	size := defaultSize
 9
10	if path != "" {
11		var err error
12		size, err = strconv.Atoi(path)
13		if err != nil {
14			panic(err)
15		}
16	}
17
18	sapin := Sapin(size)
19	output := "```\n" + sapin + "```\n"
20	return output
21}