Skip to content

Commit

Permalink
Merge pull request #2 from getmiranda/fix/get_mock_key
Browse files Browse the repository at this point in the history
fix(memcachemock): clean args in get mock key
  • Loading branch information
getmiranda authored Jun 10, 2022
2 parents ebe7375 + 007c91a commit 4b1dc3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion memcachemock/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"errors"
"strings"
"sync"

"github.com/getmiranda/gomemcached/item"
)

var (
Expand Down Expand Up @@ -91,8 +93,12 @@ func (m *mockServer) getMockKey(op Operation, args ...Args) string {
for _, v := range args[0] {
var buffer bytes.Buffer
enc := gob.NewEncoder(&buffer)
it, ok := v.(*item.Item)
if ok {
it.Expiration = 0
it.Flags = 0
}
enc.Encode(v)

key += m.cleanValue(buffer.Bytes())
}
}
Expand Down

0 comments on commit 4b1dc3f

Please sign in to comment.