Consider this example: https://play.golang.org/p/16cU0kc8Lku, basically
var Err = errors.New("sentinel")
err := errors.New("foo")
if errors.As(err, &Err) {
fmt.Println("why?")
}
I'm wondering why this matches the sentinel error, or rather how to
properly use sentinel errors. errors.As says "An
Ah, think I found it: https://blog.golang.org/go1.13-errors says:
In the simplest case, the errors.Is function behaves like a comparison to a
sentinel error, and the errors.Asfunction behaves like a type assertion.
When operating on wrapped errors, however, these functions consider all the
erro
On Mon, Aug 2, 2021 at 10:02 AM cpu...@gmail.com wrote:
> Consider this example: https://play.golang.org/p/16cU0kc8Lku, basically
>
> var Err = errors.New("sentinel")
> err := errors.New("foo")
> if errors.As(err, &Err) {
> fmt.Println("why?")
> }
>
> I'm wondering why this matches the sentinel
Hi,
I am trying to retrieve the number of page clicks recorded in GA per page
on out site for a date range using the searchconsole/v1 library. I have
created an API key for out project and it has not API restricts set yet.
I have the following questions:
1) is this the best API to use to retri
> Because both are of type `*errors.errorString`, so the types match and it
copies over the value.
Arguably, `errors.errorString` should implement `As()` and return `false`,
unless the pointers match. I suggest filing an issue.
Will do. It could also be a vet check to highlight errors.As used on
G'day,
I hope this is an appropriate place to post about a new little library.
Recently I was looking for a basic ping library but didn't have much luck,
so I hope the community will find this helpful:
https://github.com/EdgeCast/icmpengine
Feedback welcome.
Kind regards,
Dave Seddon
--
You
Hello gophers,
We have just released go1.17rc2, a release candidate version of Go 1.17.
It is cut from release-branch.go1.17 at the revision tagged go1.17rc2.
Please try your production load tests and unit tests with the new version.
Your help testing these pre-release versions is invaluable.
Re