procfs icon indicating copy to clipboard operation
procfs copied to clipboard

Use Go 1.13 error handling verb

Open SuperQ opened this issue 4 years ago • 3 comments

When using fmt.Errorf(), we should use the new %w error verb so that error messages can be unwrapped.

This would make the minimum Go version be 1.13, so we should make sure client_golang is OK with this.

SuperQ avatar Jun 14 '20 12:06 SuperQ

cc @beorn7 about the client_golang interaction.

SuperQ avatar Jun 14 '20 12:06 SuperQ

There is no fixed policy, but unless it's prohibitively cumbersome, I'd like to support three to four past Go versions, which is currently back to Go 1.12 or 1.11.

Could we use a build tag to keep supporting older build versions for a while?

beorn7 avatar Jun 14 '20 13:06 beorn7

We could, but there's no rush to do this change. It's just a nice to have to allow more verbose library errors, while still being able to parse "no such file or directory" errors.

SuperQ avatar Jun 14 '20 13:06 SuperQ

Is this not a dupe of https://github.com/prometheus/procfs/issues/358 ? If so, it has been partially implemented, with https://github.com/prometheus/procfs/issues/519 waiting for a major release in order to change the minimum Go version.

conallob avatar Nov 28 '23 15:11 conallob

Yea, this can be closed.

SuperQ avatar Nov 28 '23 15:11 SuperQ