Standard library / log/slog

slog.GroupValue()

Construct an unkeyed Group value for use in an attribute. Expected stdout: '[n=2]\n'.

Formal Syntax & Structure

go syntaxgo
func GroupValue(as ...Attr) Value

Parameters & Attributes

NameTypeDescription
as...AttrInput to the operation as described above.

Return Value

Value

Construct an unkeyed Group value for use in an attribute.

Working Example

Example Snippetgo
package main
import (  "fmt"  "log/slog")
func main() { fmt.Println(slog.GroupValue(slog.Int("n", 2))) }
Go Reference