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

cowsay state

Back to all declarations

defaultMessage

untyped string

defaultMessage is shown when no message is supplied.

Value

"Moo!"

wrapWidth

untyped bigint

wrapWidth is the maximum bubble text width (classic cowsay uses 40).

Value

(40 <untyped> bigint)

Say

func(msg string) string

Say returns the full cowsay art (speech bubble + cow) for msg. An empty msg falls back to the default message.

Open
OID
074259…af4c:3
Say details

Inspect func

balloon

func(lines []string) string

balloon builds the speech bubble around the given (already wrapped) lines.

Open
OID
074259…af4c:5
balloon details

Inspect func

borderChars

func(i int, n int) (string, string)

borderChars picks the left/right bubble characters for line i of n. Single line uses \< >. Multi-line uses / \\ for the first row, \\ / for the last row, and | | for the middle rows.

Open
OID
074259…af4c:6
borderChars details

Inspect func

wrap

func(text string, width int) []string

wrap splits text into lines no longer than width, breaking on spaces. Words longer than width are hard-split.

Open
OID
074259…af4c:7
wrap details

Inspect func

maxLen

func(lines []string) int

maxLen returns the length of the longest line.

Open
OID
074259…af4c:8
maxLen details

Inspect func

cow

untyped string

cow is the classic happy cow, aligned under the bubble.

Value

" \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n"

Render

func(path string) string

Render displays the cow for gnoweb. Render("") -> default message ("Moo!") Render("/hello there") -> renders "hello there", word-wrapped

Open
OID
074259…af4c:9
Render details

Inspect func
defaultMessage : untyped string ="Moo!"
wrapWidth : untyped bigint =(40 <untyped> bigint)
Say : func(msg string) string Inspect
balloon : func(lines []string) string Inspect
borderChars : func(i int, n int) (string, string) Inspect
wrap : func(text string, width int) []string Inspect
maxLen : func(lines []string) int Inspect
cow : untyped string =" \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n"
Render : func(path string) string Inspect