+
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zeebo/errs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.0
Choose a base ref
...
head repository: zeebo/errs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.4.0
Choose a head ref
  • 4 commits
  • 7 files changed
  • 2 contributors

Commits on Feb 28, 2023

  1. Configuration menu
    Copy the full SHA
    5a8c7a4 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2023

  1. restore API backward compatibility

    This restores the Causer and ungrouper interfaces and support for them,
    because someone might have code using them already.
    
    Also, this makes errs.Is() work (almost) the same when building with go
    < 1.20 as it does when building with go 1.20. To be specific, this adds
    support use of the `err.Is(target)` idiom.
    thepaul authored and zeebo committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    5312930 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2023

  1. support errors.Is(err, MyClass.Instance())

    The MyClass.Has(err) idiom has never been anyone's favorite thing. It
    was a necessary compromise given what was available to us at the time.
    But with the help of errors.Is(), maybe something like this is better?
    
        MyClass := errs.Class("foo")
        err := MyClass.Wrap(io.EOF)
        if errors.Is(err, MyClass.Instance()) {
            fmt.Println("err is an instance of MyClass")
        }
    
    It's still a little clunky, since we have to have the .Instance() method
    there at all. I think it's necessary to avoid having Class implement the
    error interface itself, and I think that's always been an anti-goal.
    
    Suggestions welcome for a better name.
    thepaul authored and zeebo committed May 8, 2023
    Configuration menu
    Copy the full SHA
    0c7bf7c View commit details
    Browse the repository at this point in the history
  2. add tests for (*Class).Instance()

    thepaul authored and zeebo committed May 8, 2023
    Configuration menu
    Copy the full SHA
    13450ab View commit details
    Browse the repository at this point in the history
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载