---
title: device
summary: Package device provides device dection based on the User-Agent header.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/device/
---

**Kind:** Module  
**Package:** compute-sdk-go v1.11.0  
**Path:** `github.com/fastly/compute-sdk-go/device`

Package device provides device dection based on the User-Agent
header.

## Structs

| Name | Summary |
| --- | --- |
| [Device](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/device/struct.Device/) |  |

## Functions

| Name | Summary |
| --- | --- |
| [Lookup](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/device/fn.Lookup/) |  |

## Variables

### ErrDeviceNotFound

**Type:** `error`  
**Default:** `errors.New("device not found")`  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/device/device_detection.go#L15

ErrDeviceNotFound is returned when the device is not found.

### ErrUnexpected

**Type:** `error`  
**Default:** `errors.New("unexpected error")`  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/device/device_detection.go#L18

ErrUnexpected indicates that an unexpected error occurred.
