You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many cases where it's important to distinguish between an empty/unset value and a set value that happens to be empty. This is particularly important for configuration, where the user might intentionally set a boolean to false, or an integer to 0, yet since these are default zero values in Go, we can't make that distinction. Knowing this is important for validation, as in some cases e.g. nil might not be a valid value, but it might be in others.
This is the reason most k6 options use nullable values, and while we shouldn't adopt many things from k6 configuration (grafana/k6#883 😅), I think this could be one of them. At least until croconf is ready for use, which should solve all our problems:tm:.
Suggested Solution (optional)
https://github.com/guregu/null seems to be the de facto standard library for this, though we might want to do some research if there are any reasonable alternatives.
Feature Description
There are many cases where it's important to distinguish between an empty/unset value and a set value that happens to be empty. This is particularly important for configuration, where the user might intentionally set a boolean to
false
, or an integer to0
, yet since these are default zero values in Go, we can't make that distinction. Knowing this is important for validation, as in some cases e.g.nil
might not be a valid value, but it might be in others.This is the reason most k6 options use nullable values, and while we shouldn't adopt many things from k6 configuration (grafana/k6#883 😅), I think this could be one of them. At least until croconf is ready for use, which should solve all our problems:tm:.
Suggested Solution (optional)
https://github.com/guregu/null seems to be the de facto standard library for this, though we might want to do some research if there are any reasonable alternatives.
Note that k6 itself defines some additional null types that are not found in
guregu/null
, that we might want to use.Already existing or connected issues / PRs (optional)
#611
The text was updated successfully, but these errors were encountered: