Standard library / log/slog
slog.Uint64()
Construct a keyed Uint64 attribute for structured logging. Expected stdout: 'key\n2\n'.
Formal Syntax & Structure
go syntaxgo
func Uint64(key string, v uint64) AttrParameters & Attributes
| Name | Type | Description |
|---|---|---|
| key | string | Attribute key. |
| v | uint64 | Values to log or convert. |
Return Value
Attr
Construct a keyed Uint64 attribute for structured logging.
Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog")
func main() { a := slog.Uint64("key", uint64(2)); fmt.Println(a.Key); fmt.Println(a.Value) }