Standard library / log/slog

slog.Float64Value()

Construct an unkeyed Float64 value for use in an attribute. Expected stdout: '1.5\n'.

Formal Syntax & Structure

go syntaxgo
func Float64Value(v float64) Value

Parameters & Attributes

NameTypeDescription
vfloat64Values to log or convert.

Return Value

Value

Construct an unkeyed Float64 value for use in an attribute.

Working Example

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