openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.82k stars 159 forks source link

github.com/pkg/errors should be replaced by stdlib "errors" #1507

Open mjtrangoni opened 1 year ago

mjtrangoni commented 1 year ago

Hi,

Checking my openziti_exporter project with the latest golangci-lint depguard plugin, it turns out that ziti is still using the already deprecated github.com/pkg/errors package.

See,

grep -Er 'github.com/pkg/errors' * | wc -l
     249

If you agree, I can open some "small" PRs replacing it with stdlib errors. Some other projects like prometheus started already the same procedure.

plorenz commented 12 months ago

I've got mixed feelings about this. Even though pkg/errors is an archived project, it's a very simple project and I don't anticipate that issues will crop up. stdlib errors doesn't support stacks, which can be quite useful. I also like the Wrap syntax better than the fmt with %w, as it standardizes the format.

On the flip side, no one can report issues to an archived project, so if there is an issue, we may never find out about it. Also we haven't used the stack support in some time, so maybe we don't need it.

@ekoby suggested that we remove it from all the supporting libraries, at least, so it doesn't cause issues for developers using the SDK, which I think is reasonable. Then we can think about removing it from ziti.