Standard library / log/slog

slog.StringValue()

Construct an unkeyed String value for use in an attribute. Expected stdout: 'go\n'.

Formal Syntax & Structure

go syntaxgo
func StringValue(value string) Value

Parameters & Attributes

NameTypeDescription
valuestringInput to the operation as described above.

Return Value

Value

Construct an unkeyed String value for use in an attribute.

Working Example

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