aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2020-04-10 00:23:26 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2020-04-10 00:23:26 +0100
commitc2fb89eeb14bb710aac2c88cf16e3ce8aa468dee (patch)
tree7ecc2d1626244b2fdbd88eff66d84be364c6b025 /cmd
parenta6e929541ffffe1bd37064cb0e627ca6be1acd2b (diff)
Merge ADDR and PORT
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gcp/main.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd/gcp/main.go b/cmd/gcp/main.go
index c284bbc..c726408 100644
--- a/cmd/gcp/main.go
+++ b/cmd/gcp/main.go
@@ -60,11 +60,10 @@ func main() {
log.Fatalln("os.Chmod:", err)
}
} else {
- port := os.Getenv("PORT")
- if port == "" {
- port = "8080"
+ if addr == "" {
+ addr = ":8080"
}
- if l, err = net.Listen("tcp", os.Getenv("ADDR")+":"+port); err != nil {
+ if l, err = net.Listen("tcp", addr); err != nil {
log.Fatalln("net.Listen:", err)
}
}