Standard library / log/slog
slog.AnyValue()
Construct an unkeyed Any value for use in an attribute. Expected stdout: '42\n'.
Formal Syntax & Structure
go syntaxgo
func AnyValue(v any) ValueParameters & Attributes
| Name | Type | Description |
|---|---|---|
| v | any | Values to log or convert. |
Return Value
Value
Construct an unkeyed Any value for use in an attribute.
Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog")
func main() { fmt.Println(slog.AnyValue(42)) }