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) Value

Parameters & Attributes

NameTypeDescription
vanyValues 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)) }
Go Reference