Standard library / log/slog
slog.Value.Equal()
Compare values according to their kinds and contents; non-comparable Any payloads can panic. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) Equal(w Value) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| w | Value | Writer receiving log records. |
Return Value
bool
Compare values according to their kinds and contents; non-comparable Any payloads can panic.
Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog")
func main() { fmt.Println(slog.IntValue(2).Equal(slog.Int64Value(2))) }