**安装
**
使用 go get
<pre class="brush:shell;toolbar: true; auto-links: false;">$ go get github.com/bradfitz/gomemcache/memcache</pre>
此命令后gomemcache即可使用。它的来源将是:
<pre class="brush:shell;toolbar: true; auto-links: false;">$GOPATH/src/github.com/bradfitz/gomemcache/memcache</pre>
**示例**
<pre class="brush:cpp ;toolbar: true; auto-links: false;">import (
"github.com/bradfitz/gomemcache/memcache"
)
func main() {
mc := memcache.New("10.0.0.1:11211", "10.0.0.2:11211", "10.0.0.3:11212")
mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value")})
it, err := mc.Get("foo")
...
}</pre>
**全部文档,参见:**
访问 [https://godoc.org/github.com/bradfitz/gomemcache/memcache](https://godoc.org/github.com/bradfitz/gomemcache/memcache)
运行:
<pre class="brush:shell;toolbar: true; auto-links: false;">$ godoc github.com/bradfitz/gomemcache/memcache</pre>