* Update .travis.yml
Adding Power & Updating the go versions to 1.13/1.14/1.15 as lower versions are not supported.
* Update .travis.yml
Removing go 1.13 as desired in the comment section,
* Update .travis.yml
As desired taking out the power(ppc64le) related support.,
* feat: support std errors functions
add function `Is`, `As` and `Unwrap`, like std errors, so that we can
continue to use pkg/errors with go1.13 compatibility
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* style: delete useless comments
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* build: update makefile
update makefile to download dependencies before test anything
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* build: fix makefile
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* chore: delete useless comments
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* Restore Makefile
* revert: revert some change
some change are doing by PR #206 and #212 , so I don't need to do it
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* test: add more check for As unit test
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* revert: only support Is As Unwrap for >=go1.13
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* feat(Unwrap): allow <go1.13 can use Unwrap
`Unwrap` just use type assert, it doesn't need go1.13 actually
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* test: add go1.13 errors compatibility check
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* refactor(Unwrap): don't allow <go1.13 use Unwrap
If we implement Unwrap ourselves, may create a risk of incompatibility
if Go 1.14 subtly changes its `Unwrap` implementation.
<go1.13 users doesn't have `Is` or `As`, if they want, they will use
xerrors and it also provides `Unwrap`
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
* Add support for Go 1.13 error chains
Go 1.13 adds support for error chains to the standard libary's errors
package. The new standard library functions require an Unwrap method to
be provided by an error type. This change adds a new Unwrap method
(identical to the existing Cause method) to the unexported error types.
* Add json.Marshaler support to the Frame type.
* Update regex for Go tip
* Escape periods in regular expression tests
* Implement encoding.TextMarshaler instead of json.Marshaler
Updates aws/aws-xray-sdk-go#77
Updates evalphobia/logrus_sentry#74
Go 1.12 has updated the behaviour of runtime.FuncForPC so that it
behaves as it did in Go 1.11 and earlier.
This allows errors.Frame to return to a uintptr representing the PC +1
of the caller. This will fix the build breakages of projects that were
tracking HEAD of this package.
Signed-off-by: Dave Cheney <dave@cheney.net>
With Go 1.12, we will now be doing mid-stack inlining. This exposes
inlined frames to runtime.Callers and friends.
The spec says that a runtime.Frame may have a nil Func field for
inlined functions. Instead, use the Function field to detect whether
we really have an empty Frame.
Avoid the unnecessary conversions from errors.Frame to
runtime.Frame to access the latter's fields as by definition the former
also has the same fields.
Signed-off-by: Dave Cheney <dave@cheney.net>
Remove support for Go 1.8 and earlier as they are
a. no longer supported upstream
b. lack support for runtime.CallerFrames
Signed-off-by: Dave Cheney <dave@cheney.net>
toperr is not used, but the go compiler itself doesn't detect this
because it's within an anonymous function. However, go/types does
detect this as being unused, which causes any static analysis tools
which uses go/types' type checker to fail with the message "toperr
assigned and not used".
The final result of the benchmarked function is instead assigned to
an exported global variable to ensure the compiler cannot now, nor
in the future optimise away the function calls due to no observable
side effects.
It was chosen to assign the final result, after the benchmark loop,
to the global variable, as this best follows the example set in the
CL https://go-review.googlesource.com/#/c/37195/. As opposed to
having each call to f assign to the global. This also appears to
better align with the original author's intention of toperr.
This change had no observable impact on the benchmark.
Related https://github.com/golang/go/issues/3059.
Related https://github.com/golang/go/issues/8560.
Thanks dominikh for additional clarifications.