https://go.dev/play/p/LXbkvF1LXba
package main
import (
"errors"
"fmt"
"github.com/onsi/gomega/format"
)
func main() {
err := errors.New("fake")
fmt.Println(format.Object(err, 1))
fmt.Println(format.Object(err, 0))
}
This should print the same content, just with different indentation. But in practice the "fake" string is only enclosed with quotation marks (which I prefer) inside the struct dump when indentation > 0:
<*errors.errorString | 0xc000014070>:
fake
{s: "fake"}
<*errors.errorString | 0xc000014070>:
fake
{s: fake}