---
title: Get
summary: Get retrieves the object stored in the cache for the given key. If the key is not cached, core.ErrNotFound is returned. Keys can be up to 4096 bytes in length.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/cache/simple/fn.Get/
---

**Kind:** Function  
**Module:** [simple](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/cache/simple/)  
**Package:** compute-sdk-go v1.11.0  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/cache/simple/simple.go#L29

```go
func Get(key []byte) (io.ReadCloser, error)
```

Get retrieves the object stored in the cache for the given key.  If
the key is not cached, [core.ErrNotFound] is returned.  Keys can be
up to 4096 bytes in length.

The returned [io.ReadCloser](https://pkg.go.dev/io#ReadCloser) must be closed by the caller when
finished.

**Parameters**

- `key`: `[]byte`

**Returns**

`(io.ReadCloser, error)`
