Skip to content
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

Merged
merged 10 commits into from
Jul 2, 2021
Merged

Basic types extension #6

merged 10 commits into from
Jul 2, 2021

Conversation

artych
Copy link
Contributor

@artych artych commented Jun 30, 2021

status for int(), uint(), float(*):

  • env vars

    • code
    • tests
  • [x?] json

    • code
    • [x?] tests (but fails for still unknown reasons)
  • flags:

    • code
    • tests

@artych artych requested review from na-- and codebien June 30, 2021 11:15
source_json.go Outdated Show resolved Hide resolved
Base automatically changed from ned-wip to main June 30, 2021 15:48
} else if !errors.Is(ErrorMissing, err) {
continue
}
_, ok := err.(*BindNameMissingError)
Copy link
Member

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)
Copy link
Member

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.

@artych artych marked this pull request as draft July 1, 2021 17:51
na-- and others added 2 commits July 2, 2021 14:50
source_json_test.go Outdated Show resolved Hide resolved
artych and others added 3 commits July 2, 2021 19:32
Copy link
Member

@na-- na-- left a 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!

@na-- na-- marked this pull request as ready for review July 2, 2021 17:26
@na-- na-- changed the title WIP [feat] basic types extension Basic types extension Jul 2, 2021
@na-- na-- merged commit 2402ff4 into main Jul 2, 2021
@na-- na-- deleted the basic-types branch July 2, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants