Closed sandaawa closed 3 years ago
You shouldn't usually use new
to allocate a struct in Go. There's no such thing as a constructor, but you'll typically find methods that initialize the struct. In idiomatic Go that would be NewCache
or NewTable
, but cache2go has a fairly old and established API, so here it works something like this:
cache := cache2go.Cache("myCache")
Please refer to the README and examples for more information on how to use cache2go.
Hello, I am a Golang novice. When I was learning your code, I found that I used new() to create the struct. When I access the data, panic prompt Err :nil.Is this a bug?