-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic types extension #6
Conversation
built_in_fields.go
Outdated
} else if !errors.Is(ErrorMissing, err) { | ||
continue | ||
} | ||
_, ok := err.(*BindNameMissingError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, you shouldn't type cast errors directly, use errors.As()
instead. See https://blog.golang.org/go1.13-errors
errors.go
Outdated
var ErrorMissing = errors.New("field is missing in config source") //TODO: improve | ||
|
||
type BindNameMissingError struct { | ||
Func string // the failing function (like BindIntValueTo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we need the Func
name here. If these errors ever reach the user (e.g. when something is required), they won't care about it anyway.
fix [fix] fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some minor nitpicks, but we can fix those later, in general LGTM!
status for int(), uint(), float(*):
env vars
[x?] json
flags: