Skip to content

feat(config): allow env var CATWALK_PORT to override the port#342

Open
meowgorithm wants to merge 1 commit into
mainfrom
port
Open

feat(config): allow env var CATWALK_PORT to override the port#342
meowgorithm wants to merge 1 commit into
mainfrom
port

Conversation

@meowgorithm

Copy link
Copy Markdown
Member

This allows the port to be overridden with CATWALK_PORT in the environment.

Comment thread main.go
Comment on lines +83 to +85
type config struct {
Port int `env:"CATWALK_PORT" envDefault:"8080"`
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a big deal at all, but for a single simple env, stdlib would also be fine:

port := cmp.Or(os.Getenv("CATWALK_PORT"), "8080")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, my thought here was to set this up as a best practice for future env var management, but to be fair this is indeed a premature optimization.

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