The snippet library.
Small, practical examples. Search by task or narrow things down below.
Build text incrementally
Build text incrementally using a complete Go program with explicit sample inputs.
Go✓ Tested
Compare text ignoring case
Compare text ignoring case using a complete Go program with explicit sample inputs.
Go✓ Tested
Extract digit sequences
Extract digit sequences using a complete Go program with explicit sample inputs.
Go✓ Tested
Join words with a separator
Join words with a separator using a complete Go program with explicit sample inputs.
Go✓ Tested
Remove an optional prefix
Remove an optional prefix using a complete Go program with explicit sample inputs.
Go✓ Tested
Replace literal text
Replace literal text using a complete Go program with explicit sample inputs.
Go✓ Tested
Split a key-value pair once
Split a key-value pair once using a complete Go program with explicit sample inputs.
Go✓ Tested
Split on repeated whitespace
Split on repeated whitespace using a complete Go program with explicit sample inputs.
Go✓ Tested
Trim surrounding whitespace
Trim surrounding whitespace using a complete Go program with explicit sample inputs.
Go✓ Tested