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

envPrefix is not supported #2

Closed
emmanuelay opened this issue Jan 5, 2024 · 4 comments · Fixed by #3
Closed

envPrefix is not supported #2

emmanuelay opened this issue Jan 5, 2024 · 4 comments · Fixed by #3

Comments

@emmanuelay
Copy link

I use caarlos0/env for my REST API project. The package has support for envPrefix which looks like this:

//go:generate go run github.com/g4s8/envdoc@latest -output environments.md -type Settings
type Settings struct {
	Database     Database     `envPrefix:"DB_"`
}

type Database struct {
	Port     Int     `env:"PORT,required"`
}

..which should result in: DB_PORT as an environment variable.
But instead it renders an markdown with a header, and nothing else.

Is this expected behavior or am I doing something wrong?

@g4s8
Copy link
Owner

g4s8 commented Jan 6, 2024

@emmanuelay hi, the complex structure parsing is not implemented yet, I'm going to fix it soon

@emmanuelay
Copy link
Author

Great, thanks! Really nice work btw!

g4s8 added a commit that referenced this issue Jan 8, 2024
Add `envPrefix` tag support for struct fields.

Fix: #2
g4s8 added a commit that referenced this issue Jan 9, 2024
Add `envPrefix` tag support for struct fields.

Fix: #2
@g4s8 g4s8 closed this as completed in #3 Jan 9, 2024
@g4s8
Copy link
Owner

g4s8 commented Jan 9, 2024

Thanks for reporting, now it should be fixed, you can check examples with envPrefix: https://github.com/g4s8/envdoc/blob/master/_examples/envprefix.go -> https://github.com/g4s8/envdoc/blob/master/_examples/envprefix.md

@emmanuelay
Copy link
Author

Wonderful! Thank you very much @g4s8 !

g4s8 added a commit that referenced this issue Feb 5, 2024
Render nested structures annotated with `envPrefix` as
sublists of origin field, using documentation from the
origin field as a text for this sublist.

Ref: #2
g4s8 added a commit that referenced this issue Feb 5, 2024
Render nested structures annotated with `envPrefix` as
sublists of origin field, using documentation from the
origin field as a text for this sublist.

Ref: #2
g4s8 added a commit that referenced this issue Feb 5, 2024
Render nested structures annotated with `envPrefix` as
sublists of origin field, using documentation from the
origin field as a text for this sublist.

Ref: #2
g4s8 added a commit that referenced this issue Feb 5, 2024
Render nested structures annotated with `envPrefix` as
sublists of origin field, using documentation from the
origin field as a text for this sublist.

Ref: #2
g4s8 added a commit that referenced this issue Feb 6, 2024
Fix panic when parsing an empty doc string in anonymous structure field.

Ref: #2
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 a pull request may close this issue.

2 participants