Skip to content

Commit 6fc58f7

Browse files
author
Lapp
committed
main: added host and port check for emptiness
1 parent d3eb1f5 commit 6fc58f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ func main() {
1616

1717
host := os.Getenv("CHAT_HOST")
1818
port := os.Getenv("CHAT_PORT")
19-
srv := newServer(host + ":" + port)
19+
if host == "" || port == "" {
20+
logrus.Fatalf("incorrect address to start the server")
21+
}
2022

23+
srv := newServer(host + ":" + port)
2124
go func() {
2225
if err := srv.start(); err != nil {
2326
logrus.Errorf("failed to start server: %s", err.Error())

0 commit comments

Comments
 (0)