---
title: PurgeSurrogateKey
summary: PurgeSurrogateKey purges all cached objects with the provided surrogate key.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/purge/fn.PurgeSurrogateKey/
---

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

```go
func PurgeSurrogateKey(surrogateKey string, opts PurgeOptions) error
```

PurgeSurrogateKey purges all cached objects with the provided
surrogate key.

**Parameters**

- `surrogateKey`: `string`
- `opts`: `PurgeOptions`

**Returns**

`error`
