The multierr package is not a standard Go library; you likely need errors.Join from the standard errors package to combine multiple errors. Use errors.Join to aggregate errors, then check them with errors.Is or errors.As.
import "errors"
err1 := errors.New("first error")
err2 := errors.New("second error")
combined := errors.Join(err1, err2)
if errors.Is(combined, err1) {
// handle specific error
}
If you specifically need the third-party github.com/hashicorp/go-multierr package, install it with go get github.com/hashicorp/go-multierr and use multierr.Append to combine errors.