Skip to content

Environment variables should not be used implicitly #350

@michaelknowles

Description

@michaelknowles

It looks like there are two functions that will create a Client.

  • NewClient
  • NewClientFromEnvVars

It is unexpected that NewClient would utilize any environment variables, but in fact, it uses both STREAM_CHAT_URL and STREAM_CHAT_TIMEOUT. This is unexpected behavior that I just ran into since I was using one of those variables in a different way.

I propose that only the NewClientFromEnvVars should load any environment variables. This would be a breaking change though so I wanted to get feedback before making a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions