mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 03:36:33 +03:00
Remove error return value from ConvertToOptions
ConvertToOptions can't return any error.
This commit is contained in:
parent
b1fdbf714b
commit
fedde804e3
5
main.go
5
main.go
@ -30,10 +30,7 @@ func initClientUsingBookmark(bookmarkPath, bookmarkName string) (*client.Client,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opt, err := bookmark.ConvertToOptions()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opt := bookmark.ConvertToOptions()
|
||||
var connStr string
|
||||
if opt.Url != "" { // if the bookmark has url set, use it
|
||||
connStr = opt.Url
|
||||
|
@ -28,7 +28,7 @@ func (b Bookmark) SSHInfoIsEmpty() bool {
|
||||
return b.Ssh.User == "" && b.Ssh.Host == "" && b.Ssh.Port == ""
|
||||
}
|
||||
|
||||
func (b Bookmark) ConvertToOptions() (command.Options, error) {
|
||||
func (b Bookmark) ConvertToOptions() command.Options {
|
||||
return command.Options{
|
||||
Url: b.Url,
|
||||
Host: b.Host,
|
||||
@ -37,7 +37,7 @@ func (b Bookmark) ConvertToOptions() (command.Options, error) {
|
||||
Pass: b.Password,
|
||||
DbName: b.Database,
|
||||
Ssl: b.Ssl,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func readServerConfig(path string) (Bookmark, error) {
|
||||
|
@ -130,8 +130,6 @@ func Test_ConvertToOptions(t *testing.T) {
|
||||
DbName: "mydatabase",
|
||||
Ssl: "disable",
|
||||
}
|
||||
opt, err := b.ConvertToOptions()
|
||||
if assert.NoError(t, err) {
|
||||
assert.Equal(t, expOpt, opt)
|
||||
}
|
||||
opt := b.ConvertToOptions()
|
||||
assert.Equal(t, expOpt, opt)
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user