hetznercloud / hcloud-go

A Go library for the Hetzner Cloud API
https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud
MIT License
371 stars 45 forks source link

feat: allow checking multiple errors codes in `IsError` #491

Closed jooola closed 1 month ago

jooola commented 1 month ago

Useful when one need to check multiple error codes at once, without having to cast every time.

-hcloud.IsError(err, hcloud.ErrorCodeConflict) || hcloud.IsError(err, hcloud.ErrorCodeLocked)
+hcloud.IsError(err, hcloud.ErrorCodeConflict, hcloud.ErrorCodeLocked)
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.53%. Comparing base (cf9fdaf) to head (418e4cf).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #491 +/- ## ======================================= Coverage 71.53% 71.53% ======================================= Files 46 46 Lines 3910 3910 ======================================= Hits 2797 2797 Misses 699 699 Partials 414 414 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.