Skip to content

Instantly share code, notes, and snippets.

@178inaba
Created January 25, 2021 03:51
Show Gist options
  • Save 178inaba/8a04dc5889c01b37784a3a98ebe33213 to your computer and use it in GitHub Desktop.
Save 178inaba/8a04dc5889c01b37784a3a98ebe33213 to your computer and use it in GitHub Desktop.
Check `errors.Is()`.
package main
import (
"errors"
"fmt"
"io"
)
func main() {
err := fmt.Errorf("fail: %w", fmt.Errorf("fail: %w", io.EOF))
fmt.Println(errors.Is(err, io.EOF))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment