Skip to content

Commit

Permalink
fix: element name -> element value
Browse files Browse the repository at this point in the history
  • Loading branch information
schwern committed Mar 1, 2023
1 parent 2f375a6 commit 49552e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions momento/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ func prepareName(name string, label string) (string, error) {
func prepareElementValue(name Value) ([]byte, error) {
if name == nil {
return nil, buildError(
momentoerrors.InvalidArgumentError, "element name cannot be nil or empty", nil,
momentoerrors.InvalidArgumentError, "element value cannot be nil or empty", nil,
)
}

// just validate not empty using prepareName
nameBytes := name.asBytes()
_, err := prepareName(string(nameBytes), "element name")
_, err := prepareName(string(nameBytes), "element value")
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions momento/sorted_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ var _ = Describe("SortedSet", func() {
).To(Equal(&SortedSetGetRankHit{Rank: 0}))
})

It(`returns an error for a nil element name`, func() {
It(`returns an error for a nil element value`, func() {
Expect(
sharedContext.Client.SortedSetGetRank(
sharedContext.Ctx,
Expand Down Expand Up @@ -385,7 +385,7 @@ var _ = Describe("SortedSet", func() {
))
})

It(`returns an error when element names are nil`, func() {
It(`returns an error when element values are nil`, func() {
Expect(
sharedContext.Client.SortedSetGetScore(
sharedContext.Ctx,
Expand Down Expand Up @@ -486,7 +486,7 @@ var _ = Describe("SortedSet", func() {
).To(BeAssignableToTypeOf(&SortedSetIncrementScoreSuccess{Value: 50}))
})

It("returns an error when element name is nil", func() {
It("returns an error when element value is nil", func() {
Expect(
sharedContext.Client.SortedSetIncrementScore(
sharedContext.Ctx,
Expand Down

0 comments on commit 49552e0

Please sign in to comment.