Move bookmark default port parsing to readServerConfig func
This commit is contained in:
@@ -49,6 +49,11 @@ func readServerConfig(path string) (Bookmark, error) {
|
||||
}
|
||||
|
||||
_, err = toml.Decode(string(buff), &bookmark)
|
||||
|
||||
if bookmark.Port == 0 {
|
||||
bookmark.Port = 5432
|
||||
}
|
||||
|
||||
return bookmark, err
|
||||
}
|
||||
|
||||
@@ -101,9 +106,5 @@ func GetBookmark(bookmarkPath string, bookmarkName string) (Bookmark, error) {
|
||||
return Bookmark{}, fmt.Errorf("couldn't find a bookmark with name %s", bookmarkName)
|
||||
}
|
||||
|
||||
if bookmark.Port == 0 {
|
||||
bookmark.Port = 5432
|
||||
}
|
||||
|
||||
return bookmark, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user