Standard library / log/slog

slog.IntValue()

Construct an unkeyed Int value for use in an attribute. Expected stdout: '2\n'.

Formal Syntax & Structure

go syntaxgo
func IntValue(v int) Value

Parameters & Attributes

NameTypeDescription
vintValues to log or convert.

Return Value

Value

Construct an unkeyed Int value for use in an attribute.

Working Example

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