Skip to content

Commit 74869e5

Browse files
committed
fix: removed unused error return
1 parent 66e8380 commit 74869e5

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

bluemix/configuration/core_config/bx_config.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,7 @@ func (c *bxConfig) ClearPaginationURLs() {
771771
}
772772

773773
func (c *bxConfig) AddPaginationURL(index int, url string) error {
774-
urls, err := c.PaginationURLs()
775-
if err != nil {
776-
return err
777-
}
774+
urls := c.PaginationURLs()
778775

779776
urls = append(urls, models.PaginationURL{
780777
LastIndex: index,
@@ -787,7 +784,7 @@ func (c *bxConfig) AddPaginationURL(index int, url string) error {
787784
return nil
788785
}
789786

790-
func (c *bxConfig) PaginationURLs() (paginationURLs []models.PaginationURL, err error) {
787+
func (c *bxConfig) PaginationURLs() (paginationURLs []models.PaginationURL) {
791788
c.read(func() {
792789
paginationURLs = c.data.PaginationURLs
793790
})

bluemix/configuration/core_config/bx_config_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,7 @@ func TestPaginationURLs(t *testing.T) {
473473
config := prepareConfigForCLI(`{}`, t)
474474

475475
// check initial state
476-
paginationURLs, err := config.PaginationURLs()
477-
assert.Nil(t, err)
476+
paginationURLs := config.PaginationURLs()
478477
assert.Empty(t, paginationURLs)
479478

480479
// update session
@@ -485,10 +484,8 @@ func TestPaginationURLs(t *testing.T) {
485484
},
486485
}
487486
config.SetPaginationURLs(expected)
488-
assert.Nil(t, err)
489487

490-
paginationURLs, err = config.PaginationURLs()
491-
assert.Nil(t, err)
488+
paginationURLs = config.PaginationURLs()
492489
assert.Equal(t, 1, len(paginationURLs))
493490
assert.Equal(t, expected[0].LastIndex, paginationURLs[0].LastIndex)
494491
assert.Equal(t, expected[0].NextURL, paginationURLs[0].NextURL)

bluemix/configuration/core_config/repository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ type Repository interface {
129129
SetPaginationURLs(paginationURLs []models.PaginationURL)
130130
ClearPaginationURLs()
131131
AddPaginationURL(lastIndex int, nextURL string) error
132-
PaginationURLs() ([]models.PaginationURL, error)
132+
PaginationURLs() []models.PaginationURL
133133
}
134134

135135
// Deprecated
@@ -373,7 +373,7 @@ func (c repository) SetLastSessionUpdateTime() {
373373
c.bxConfig.SetLastSessionUpdateTime()
374374
}
375375

376-
func (c repository) PaginationURLs() ([]models.PaginationURL, error) {
376+
func (c repository) PaginationURLs() []models.PaginationURL {
377377
return c.bxConfig.PaginationURLs()
378378
}
379379

common/rest/request_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ func TestAddPaginationURL(t *testing.T) {
201201
}
202202

203203
// expect url to be sorted in ascending order by LastIndex
204-
sortedUrls, err := config.PaginationURLs()
205-
assert.Nil(err)
204+
sortedUrls := config.PaginationURLs()
206205

207206
assert.Equal(2, len(sortedUrls))
208207
assert.Equal(sortedUrls[0].LastIndex, unsortedUrls[1].LastIndex)

0 commit comments

Comments
 (0)