Skip to content

Add GetFieldParams and GetFieldParamsWithOptions functions#261

Merged
caarlos0 merged 5 commits intocaarlos0:mainfrom
saturn4er:feature/get_field_params
Jul 25, 2023
Merged

Add GetFieldParams and GetFieldParamsWithOptions functions#261
caarlos0 merged 5 commits intocaarlos0:mainfrom
saturn4er:feature/get_field_params

Conversation

@saturn4er
Copy link
Copy Markdown
Contributor

Here's example implementation for #260, not really sure about names I used :)

@saturn4er
Copy link
Copy Markdown
Contributor Author

@caarlos0 Any problems with this concept?

@caarlos0
Copy link
Copy Markdown
Owner

Implementation looks OK, but needs merge with main.

@saturn4er
Copy link
Copy Markdown
Contributor Author

Done

}

func parseInternal(v interface{}, opts Options) error {
func GetFieldParams(v interface{}) ([]FieldParams, error) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing godoc

return GetFieldParamsWithOptions(v, defaultOptions())
}

func GetFieldParamsWithOptions(v interface{}, opts Options) ([]FieldParams, error) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing godoc

var unset bool
var notEmpty bool
var expand bool
type FieldParams struct {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing godoc

@caarlos0
Copy link
Copy Markdown
Owner

hey, just missing the godocs and pass golangci-lint :P
sorry I missed it earlier

thank you

@saturn4er
Copy link
Copy Markdown
Contributor Author

@caarlos0 No problem, I've made the corrections you suggested.

@caarlos0 caarlos0 merged commit e7e49c4 into caarlos0:main Jul 25, 2023
@caarlos0
Copy link
Copy Markdown
Owner

merged, thank you!

BorzdeG pushed a commit to BorzdeG/env that referenced this pull request Aug 24, 2024
…0#261)

* Add GetFieldParams and GetFieldParamsWithOptions functions

* Add nested structure to tests

* Fixes after merge with origin/main

* Added missing godocs and fixed golangci-lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants