Go Examples

Page 3 of 8

Browse Go examples

goSnippet

GCD And LCM With big.Int

Compute GCD and LCM with math/big.Int so values beyond int64 never overflow, and reduce fractions by dividing out the common divisor.

goSnippet

Inspect Float Bits Float64bits

Split IEEE-754 doubles into sign, exponent, and mantissa fields with math.Float64bits, and see why bitwise comparison is the only reliable NaN identity test.

goSnippet

Hex Dump Rows With Offsets

Render arbitrary bytes as an offset-labeled hex dump with hex.EncodeToString and manual column math, the layout debuggers and protocol tools print.

goSnippet

DumpRequest Wire Level Preview

Preview the wire format of a request with httputil.DumpRequest so the request line, Host header, and body framing are visible without a packet capture.