Skip to content

Commit b504e7f

Browse files
author
nerves_dev
committed
Refactoring: Move param definitions to var section
1 parent e8c1bd3 commit b504e7f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

main.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ type discordEmbedField struct {
7070

7171
const defaultListenAddress = "127.0.0.1:9094"
7272

73-
func main() {
74-
envWhURL := os.Getenv("DISCORD_WEBHOOK")
75-
whURL := flag.String("webhook.url", envWhURL, "Discord WebHook URL.")
76-
77-
envListenAddress := os.Getenv("LISTEN_ADDRESS")
78-
listenAddress := flag.String("listen.address", envListenAddress, "Address:Port to listen on.")
73+
var (
74+
whURL = flag.String("webhook.url", os.Getenv("DISCORD_WEBHOOK"), "Discord WebHook URL.")
75+
listenAddress = flag.String("listen.address", os.Getenv("LISTEN_ADDRESS"), "Address:Port to listen on.")
76+
)
7977

78+
func main() {
8079
flag.Parse()
8180

8281
if *whURL == "" {

0 commit comments

Comments
 (0)