Skip to content

Commit

Permalink
Remove error return value from ConvertToOptions
Browse files Browse the repository at this point in the history
ConvertToOptions can't return any error.
  • Loading branch information
akarki15 committed Nov 16, 2016
1 parent b1fdbf7 commit fedde80
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 261 deletions.
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/bookmarks/bookmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down
6 changes: 2 additions & 4 deletions pkg/bookmarks/bookmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
427 changes: 176 additions & 251 deletions pkg/data/bindata.go

Large diffs are not rendered by default.

0 comments on commit fedde80

Please sign in to comment.