mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
unmarshal into interface
This commit is contained in:
4
cache/handler/cache.go
vendored
4
cache/handler/cache.go
vendored
@@ -16,7 +16,7 @@ func (c *Cache) Get(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse
|
||||
return errors.BadRequest("cache.get", "missing key")
|
||||
}
|
||||
|
||||
var value string
|
||||
var value interface{}
|
||||
|
||||
if err := cache.Context(ctx).Get(req.Key, &value); err != nil {
|
||||
return errors.InternalServerError("cache.get", err.Error())
|
||||
@@ -24,7 +24,7 @@ func (c *Cache) Get(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse
|
||||
|
||||
rsp.Key = req.Key
|
||||
// set the value
|
||||
rsp.Value = value
|
||||
rsp.Value = fmt.Sprintf("%v", value)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user