microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
946 stars 180 forks source link

Replace github.com/pkg/errors with stdlib errors #227

Closed mversiotech closed 2 years ago

mversiotech commented 2 years ago

Since Go version 1.13, the standard library has built-in support for wrapping and unwrapping of error values. This commit bumps the minimum version required by the module from 1.12 to 1.13, replaces all calls to errors.Wrap/f with fmt.Errorf and removes the now unneeded dependency on github.com/pkg/errors.

Signed-off-by: Michael Hofmann michael.hofmann@bitgestalt.com

ghost commented 2 years ago

CLA assistant check
All CLA requirements met.

katiewasnothere commented 2 years ago

@bitgestalt Was there a specific need for this? I think we prefer using the errors package here.

mversiotech commented 2 years ago

@bitgestalt Was there a specific need for this? I think we prefer using the errors package here.

errors is a third-party package and, insofar as it is used by this module, its functionality is fully covered by the Go standard library. On top of that, errors is currently in maintenance mode and no longer actively under development and apparently also unmaintained . The one feature errors.Wrap has and fmt.Errorf has not - stack traces on errors - is only marginally useful since only a small subset of errors returned by functions in this module are created by errors.Wrap.

In short, unless you want to maintain strict compatibility with Go 1.12, I can see no good reason to keep depending on the external errors package.