Standard library / log/slog
slog.Attr.String()
Return the diagnostic string form key=value, not a full structured record. Expected stdout: 'n=2\n'.
Formal Syntax & Structure
go syntaxgo
func (a Attr) String() stringReturn Value
string
Return the diagnostic string form key=value, not a full structured record.
Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog")
func main() { fmt.Println(slog.Int("n", 2).String()) }