Results for “Go”
Small, practical examples. Search by task or narrow things down below.
Format a UTC timestamp
Format a UTC timestamp using a complete Go program with explicit sample inputs.
Go✓ Tested
Generate a bounded Fibonacci sequence
C: Keep only the two previous values instead of using exponential recursive calls.
C✓ Tested
Group fields in a struct
Group fields in a struct using a complete Go program with explicit sample inputs.
Go✓ Tested
Handle a failed conversion
Handle a failed conversion using a complete Go program with explicit sample inputs.
Go✓ Tested
Increment an atomic counter
Increment an atomic counter using a complete Go program with explicit sample inputs.
Go✓ Tested
Initialize a resource only once
Initialize a resource only once using a complete Go program with explicit sample inputs.
Go✓ Tested
Inspect a typed conversion error
Inspect a typed conversion error using a complete Go program with explicit sample inputs.
Go✓ Tested
Inspect a value with a type switch
Inspect a value with a type switch using a complete Go program with explicit sample inputs.
Go✓ Tested
Inspect a value’s type
Inspect a value’s type using a complete Go program with explicit sample inputs.
Go✓ Tested
Iterate over bounded chunks
Iterate over bounded chunks using a complete Go program with explicit sample inputs.
Go✓ Tested
Join portable path components
Join portable path components 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