Results for “Go”
Small, practical examples. Search by task or narrow things down below.
Return a descriptive validation error
Return a descriptive validation error using a complete Go program with explicit sample inputs.
Go✓ Tested
Return two values from a function
Return two values from a function using a complete Go program with explicit sample inputs.
Go✓ Tested
Reverse slice order
Reverse slice order using a complete Go program with explicit sample inputs.
Go✓ Tested
Rotate a sequence around a selected position
C++: rotate places the element at the middle iterator first while preserving the two segment orders.
C++✓ Tested
Round down to a whole minute
Round down to a whole minute using a complete Go program with explicit sample inputs.
Go✓ Tested
Run cleanup when a function returns
Run cleanup when a function returns using a complete Go program with explicit sample inputs.
Go✓ Tested
Scan whitespace-separated tokens
Scan whitespace-separated tokens using a complete Go program with explicit sample inputs.
Go✓ Tested
Send a JSON HTTP response
Send a JSON HTTP response using a complete Go program with explicit sample inputs.
Go✓ Tested
Separate a filename extension
Separate a filename extension using a complete Go program with explicit sample inputs.
Go✓ Tested
Set and retrieve an HTTP header
Set and retrieve an HTTP header using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort integers in place
Sort integers in place using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort map keys for stable output
Sort map keys for stable output using a complete Go program with explicit sample inputs.
Go✓ Tested