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

v0 state

Back to all declarations

samples

[]struct{...} (len=4)

samples are shown on the root page: a valid number, a typo'd one, and a transposition — the two error classes Luhn is designed to catch.

Open
OID
0a6388…0624:4
samples details (len=4)

+4 more Inspect slice

Render

func(path string) string

Render renders the checker for gnoweb. Render("") / Render("/") -> usage + worked samples Render("/<digits>") -> verdict for that number

Open
OID
0a6388…0624:9
Render details

Inspect func

parseInput

func(path string) string

parseInput extracts the first path segment.

Open
OID
0a6388…0624:11
parseInput details

Inspect func

trimLast

func(s string) (string, bool)

trimLast drops the final digit, ignoring separators, to recover the payload.

Open
OID
0a6388…0624:12
trimLast details

Inspect func
samples : []struct{...} (len=4) Inspect
Render : func(path string) string Inspect
parseInput : func(path string) string Inspect
trimLast : func(s string) (string, bool) Inspect
verdict : func(ok bool) string Inspect