Description
type TcgPrice struct
{ XMLName xml.Name `xml:"products" json:"-"` Id int `xml:"product>id" json:"id"` HiPrice float64 `xml:"product>hiprice" json:"hi_price"` LowPrice float64 `xml:"product>lowprice" json:"low_price"` AvgPrice float64 `xml:"product>avgprice" json:"avg_price"` FoilAvgPrice float64 `xml:"product>foilavgprice" json:"foil_avg_price"` Demo string `json:"demo"` }func (m *Card) GetPrices(b *gocouchbase.Bucket) (price *TcgPrice, err error) {
key := fmt.Sprintf("%s-tcgprice", m.ID)
if _, _, err = b.Get(key, &price); err == nil
// TODO: change me to ErrStatusNotFound when
// Bret relesase the fix for gocouchbaseio
switch err.Error() {
case "Key not found.":
price = &TcgPrice
_, err = b.Insert(key, price, uint32(60*60*2))
return
}
return
}
This sample function I wrote to get a cached object or populate it, is erroring out on bucket.Get and I don't see any reason why.
The bucket type is Couchbase (not memcahe)
"Unexpected legacy flags value"
Thank you
Attachments
Issue Links
- is duplicated by
-
GOCBC-20 get fails on decoding
- Resolved