FIND YOUR NEXT FEW LINES

Results for “Go”

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

182 snippets foundClear filters
GitRestoring & revising local work

Add a forgotten file to the latest unpublished commit

Git: Stage the missing file before amending without changing the message.

Git✓ Tested
JavaDates & time zones

Check the Gregorian leap-year rule

Java: Use Year.isLeap rather than checking divisibility by four alone.

Java✓ Tested
SQLExpressions & aggregates

Count rows per category

Aggregate rows sharing the same category.

GROUP BY✓ Tested
C++Sequence algorithms

Find both extremes in one algorithm call

C++: Check for a nonempty input before dereferencing the returned iterators.

C++✓ Tested
AngularLifecycle & observable data

Initialize component data with ngOnInit

Initialize component data with ngOnInit with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
GoDates & times

Parse a date with a Go layout

Parse a date with a Go layout using a complete Go program with explicit sample inputs.

Go✓ Tested
GoConcurrency & cancellation

Receive a result from a goroutine

Receive a result from a goroutine using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Run your first Go program

Run your first Go program using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLExpressions & aggregates

Sum values per category

Calculate a grouped total.

SUM✓ Tested
GoFunctions & types

Accept a small behavior interface

Accept a small behavior interface using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFunctions & types

Accept a variable number of arguments

Accept a variable number of arguments using a complete Go program with explicit sample inputs.

Go✓ Tested
GoDates & times

Advance a calendar date

Advance a calendar date using a complete Go program with explicit sample inputs.

Go✓ Tested