diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2021-08-03 18:07:45 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2021-08-03 13:07:45 -0700 |
| commit | 58efb95f86cd806dda8cf00ad45d4347307a2306 (patch) | |
| tree | 9b8910bce7126696e774c6b769537a5927adeb2e /hotline/ui.go | |
| parent | da1e0d79561ded0b3998a50a1d14a16b5c9a24bc (diff) | |
Default to port 5500 if undefined
Diffstat (limited to 'hotline/ui.go')
| -rw-r--r-- | hotline/ui.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hotline/ui.go b/hotline/ui.go index b8c0430..f21f1e8 100644 --- a/hotline/ui.go +++ b/hotline/ui.go @@ -187,6 +187,10 @@ func (ui *UI) renderSettingsForm() *tview.Flex { } func (ui *UI) joinServer(addr, login, password string) error { + // append default port to address if no port supplied + if len(strings.Split(addr, ":")) == 1 { + addr += ":5500" + } if err := ui.HLClient.JoinServer(addr, login, password); err != nil { return errors.New(fmt.Sprintf("Error joining server: %v\n", err)) } |