Standard library / log/slog

slog.BoolValue()

Construct an unkeyed Bool value for use in an attribute. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func BoolValue(v bool) Value

Parameters & Attributes

NameTypeDescription
vboolValues to log or convert.

Return Value

Value

Construct an unkeyed Bool value for use in an attribute.

Working Example

Example Snippetgo
package main
import (  "fmt"  "log/slog")
func main() { fmt.Println(slog.BoolValue(true)) }
Go Reference