We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0944aa3 commit 7cbc89aCopy full SHA for 7cbc89a
cmd/miniflux-discord/main.go
@@ -16,23 +16,21 @@ var (
16
)
17
18
func parseEnv() error {
19
- envPort := os.Getenv("LISTEN_PORT")
20
- if envPort == "" {
21
- LISTEN_PORT = 8080
22
- } else {
+ if envPort := os.Getenv("LISTEN_PORT"); envPort != "" {
23
var err error
24
LISTEN_PORT, err = strconv.Atoi(envPort)
25
if err != nil {
26
return err
27
}
+ } else {
+ LISTEN_PORT = 8080
28
29
30
- envAddr := os.Getenv("LISTEN_ADDR")
31
- if envAddr == "" {
32
- LISTEN_ADDR = "0.0.0.0"
33
+ if envAddr := os.Getenv("LISTEN_ADDR"); envAddr != "" {
34
// TODO: validate
35
LISTEN_ADDR = envAddr
+ LISTEN_ADDR = "0.0.0.0"
36
37
38
if discordFile := os.Getenv("DISCORD_WEBHOOK_URL_FILE"); discordFile != "" {
0 commit comments