open-feature / open-feature/go-sdk

Remove evaluation functions returning errors

Open
#417 1 comment 0 reactions 0 assignees View on GitHub
needs discussion v2
Dominant language
Go
Stars
249
Forks
61
Avg merge
2d 10h
Merged PRs (30d)
20

Description

> [Suggested by @toddbaert] We could consider removing [these functions](https://github.com/open-feature/go-sdk/blob/bf2d408e2945f2de67a0d3e608adb630df5c0881/openfeature/interfaces.go#L30-L34) entirely. They return errors directly, which add complexity and is arguably against the spec, which says evaluation methods should never abnormally terminate (returning a non-nil error in Go signals an abnormal termination equivalent to throwing IMO). People actually complained about the ergonomics of these and we implemented the [non-error-returning versions in response](https://github.com/open-feature/go-sdk/blob/bf2d408e2945f2de67a0d3e608adb630df5c0881/openfeature/interfaces.go#L41-L45). The "detailed" evaluation methods also return errors, and we have no "non-error" variant. We should consider our options here to make these consistent and idiomatic.

Consider removing evaluation functions returning errors. This is somewhat against spec, and people complained about the ergonomics long ago, causing us to build the non-error-returning versions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.