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

Added unset-not-found flag #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svyatogor
Copy link

In some cases we want to pass env variables that might not be present in AWS SSM Param store but could be added later. This flag lets you ignore such variables and unset them in the environment.

@@ -35,22 +36,24 @@ type LimitedParamsGetter interface {
// given value prefix, using the given ParamsGetter.
//
// NewReplacer will panic if envValuePrefix is the empty string.
func NewReplacer(envValuePrefix string, ssm ParamsGetter) *Replacer {
func NewReplacer(envValuePrefix string, unsetNotFound bool, ssm ParamsGetter) *Replacer {
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes the function signature, and thus would represent a breaking change. We could instead just expose UnsetNotFound on the Replacer struct, so that it can be set to true after calling NewReplacer; adding new fields to a struct is not considered a breaking change by the Go community.

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.

2 participants