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

tweak NewSdkCollectionFromEnv and fix the http-client example #662

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

dovholuknf
Copy link
Member

No description provided.

@dovholuknf dovholuknf requested a review from a team as a code owner January 22, 2025 19:25
@@ -62,7 +62,7 @@ func NewSdkCollection() *CtxCollection {

// NewSdkCollectionFromEnv will create an empty CtxCollection and then attempt to populate it from configuration files
// provided in a semicolon separate list of file paths retrieved from an environment variable.
func NewSdkCollectionFromEnv(envVariable string) *CtxCollection {
func NewSdkCollectionFromEnv(envVariable string, configTypes []string) *CtxCollection {
Copy link
Member

@andrewpmartinez andrewpmartinez Jan 22, 2025

Choose a reason for hiding this comment

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

This is an externally consumed function, this would be a major bump if left as as.

You chould make it take an an optional number of strings, which can be 0 or more.

NewSdkCollectionFromEnv(envVariable string, configTypes ...string)

Which allows 0 or more config types to be specified. You still access configTypes like a slice.

This allow old calls NewSdkCollection("myEnv") and NewSdkCollection("myEnv", "config1", "config2") or using an exploded slice NewSdkCollection("myEnv", myConfigs...) where myConfig := []string{"confi1","config2"}

Copy link
Member Author

Choose a reason for hiding this comment

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

that is a grand idea. done

@dovholuknf dovholuknf merged commit a195721 into main Jan 23, 2025
10 checks passed
@dovholuknf dovholuknf deleted the fix-http-client-example branch January 23, 2025 13:21
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.

3 participants