FIND YOUR NEXT FEW LINES

Results for “Go”

Small, practical examples. Search by task or narrow things down below.

182 snippets foundClear filters
GoTesting & reusable helpers

Sort records by a selected field

Sort records by a selected field using a complete Go program with explicit sample inputs.

Go✓ Tested
GoStrings & text

Split a key-value pair once

Split a key-value pair once using a complete Go program with explicit sample inputs.

Go✓ Tested
GoStrings & text

Split on repeated whitespace

Split on repeated whitespace using a complete Go program with explicit sample inputs.

Go✓ Tested
CSmall algorithms & bit operations

Sum the decimal digits of an unsigned integer

C: Repeated division and remainder extract digits without converting to text.

C✓ Tested
GoHTTP & URLs

Test an HTTP handler without a server

Test an HTTP handler without a server using a complete Go program with explicit sample inputs.

Go✓ Tested
C++Sequence algorithms

Test any and all elements with predicates

C++: These algorithms stop as soon as their result is known.

C++✓ Tested
GoGetting Started

Test whether a number is even

Test whether a number is even using a complete Go program with explicit sample inputs.

Go✓ Tested
CSmall algorithms & bit operations

Test whether an unsigned value is a power of two

C: A nonzero power of two has exactly one set bit.

C✓ Tested
C++Sequence algorithms

Transform a vector into a separate result

C++: Pre-size the output before writing through its iterator.

C++✓ Tested
GoStrings & text

Trim surrounding whitespace

Trim surrounding whitespace using a complete Go program with explicit sample inputs.

Go✓ Tested
GoConcurrency & cancellation

Try a channel receive without blocking

Try a channel receive without blocking using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Understand default zero values

Understand default zero values using a complete Go program with explicit sample inputs.

Go✓ Tested