You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cache.go
    path of file: ./repos/mindoc/cache
    
    the code of the file until where you have to start completion: package cache

import (
	"bytes"
	"context"
	"encoding/gob"
	"errors"
	"time"


    
func Get(key string, e interface{}) error {

	val, err := bm.Get(nilctx, key)

	if err != nil {
		return errors.New("get cache error:" + err.Error())
	}

	if val == nil {
		return errors.New("cache does not exist")
	}
	if b, ok := val.([]byte); ok {
		buf := bytes.NewBuffer(b)

		decoder := gob.NewDecoder(buf)

		err := decoder.Decode(e)

		if err != nil {
			logs.Error("反序列化对象失败 ->", err)
		}
		return err
	} else if s, ok := val.(string); ok && s != "" {

		buf := bytes.NewBufferString(s)

		decoder := gob.NewDecoder(buf)

		err := decoder.Decode(e)

		if err != nil {
			logs.Error("反序列化对象失败 ->", err)
		}
		return err
	}
	return errors.New("value is not []byte or string")
}