Draft
Conversation
- add envcase to addTags, the flag description, README.md, and the test cases - BREAKING CHANGE: bump go version to 1.16 - update dependencies
feat(template): Add envcase like `ENV_VARIABLE`
…ied envcase - add `-print-envs` flag which defaults to false in order to print an env template file - add `-envs-filename` flag to change the default `./.env` file location - modified envcase to add the struct name at the beginning of the env like: `STRUCT_ENV_VARIABLE` - modified test cases - modified README.md - minor spelling change -- splitted to split - changed main.go ln 676 from errors.New(fmt.Sprintf(...)) to fmt.Errorf(...) to make the linter a happy camper
Author
|
Hold on this -- have some weirdness in the generation of the tag names. Once I sort this out, I will fix this PR...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OVERVIEW
So, have to say I love this tool. Thank you for your work on this! I am in the middle of a major refactor of about 50 services and this was the answer. I made a few modifications to fit my specific use case and some of this may be too specific for your tool but wanted to run these modifications by you in case you liked any of this. Feel free to ask for more general modification to fit your vision, or just say thanks but no thanks if you want -- no worries at all my friend.
So the specifics are I am tooling our golang services to use https://github.com/ardanlabs/conf as our configuration loader and needed our config structures to support the env specific tags like
conf:"env:IM_A_ENV". I also needed a simple way to print an env template for our ansible playbooks (company's choice).I felt it was important for the env to reflect the golang struct name first, then the property next.
SPECIFIC REQUIREMENTS
envcaselikeENV_VARIABLEin order to refactor current non-docker services to support an .env file.ENV_VARIABLE=variableformat for the dev-ops team.ADDITIONAL
$fielddocumentation to single quotes in lieu of double quotes (worked on Linux -- to be honest, did not test this on Windows or MAC).