{"action":"created","issue":{"url":"https://api.github.com/repos/patrickmn/go-cache/issues/26","labels_url":"https://api.github.com/repos/patrickmn/go-cache/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/patrickmn/go-cache/issues/26/comments","events_url":"https://api.github.com/repos/patrickmn/go-cache/issues/26/events","html_url":"https://github.com/patrickmn/go-cache/issues/26","id":120088332,"number":26,"title":"Why are the keys strings?","user":{"login":"tedkornish","id":2671967,"avatar_url":"https://avatars.githubusercontent.com/u/2671967?v=3","gravatar_id":"","url":"https://api.github.com/users/tedkornish","html_url":"https://github.com/tedkornish","followers_url":"https://api.github.com/users/tedkornish/followers","following_url":"https://api.github.com/users/tedkornish/following{/other_user}","gists_url":"https://api.github.com/users/tedkornish/gists{/gist_id}","starred_url":"https://api.github.com/users/tedkornish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tedkornish/subscriptions","organizations_url":"https://api.github.com/users/tedkornish/orgs","repos_url":"https://api.github.com/users/tedkornish/repos","events_url":"https://api.github.com/users/tedkornish/events{/privacy}","received_events_url":"https://api.github.com/users/tedkornish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-03T03:42:21Z","updated_at":"2015-12-04T00:45:46Z","closed_at":null,"body":"Hey there,\r\n\r\nA coworker and I were wondering about the reasoning behind making keys to the cache strings. Using structs as keys in maps is slower and often less convenient than using structs (as Ashish Gandhi details towards the end of [this talk](https://www.hakkalabs.co/articles/optimizing-go-3k-requestssec-480k-requestssec)). Is it because allowing for a cache key of `interface{}` introduces the risk of runtime type error if a user tried to store, say, a slice?\r\n\r\nThanks for writing and maintaining the package!\r\n\r\nT"},"comment":{"url":"https://api.github.com/repos/patrickmn/go-cache/issues/comments/161838856","html_url":"https://github.com/patrickmn/go-cache/issues/26#issuecomment-161838856","issue_url":"https://api.github.com/repos/patrickmn/go-cache/issues/26","id":161838856,"user":{"login":"Freeaqingme","id":33034,"avatar_url":"https://avatars.githubusercontent.com/u/33034?v=3","gravatar_id":"","url":"https://api.github.com/users/Freeaqingme","html_url":"https://github.com/Freeaqingme","followers_url":"https://api.github.com/users/Freeaqingme/followers","following_url":"https://api.github.com/users/Freeaqingme/following{/other_user}","gists_url":"https://api.github.com/users/Freeaqingme/gists{/gist_id}","starred_url":"https://api.github.com/users/Freeaqingme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Freeaqingme/subscriptions","organizations_url":"https://api.github.com/users/Freeaqingme/orgs","repos_url":"https://api.github.com/users/Freeaqingme/repos","events_url":"https://api.github.com/users/Freeaqingme/events{/privacy}","received_events_url":"https://api.github.com/users/Freeaqingme/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T00:45:46Z","updated_at":"2015-12-04T00:45:46Z","body":"Did you try to use interface{} or *interface{} ? There should not be any runtime overhead as long as you're not using type assertions."}}