Standard library / log/slog
slog.Attr.Equal()
Compare attribute keys and values using Value.Equal. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (a Attr) Equal(b Attr) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| b | Attr | Input to the operation as described above. |
Return Value
bool
Compare attribute keys and values using Value.
Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog")
func main() { fmt.Println(slog.Int("n", 2).Equal(slog.Int("n", 2))) }