---
sidebar_label: Go
title: Connect with Go Connector
pagination_next: develop/insert-data
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
## Initialize Module
```
go mod init tdengine.com/example
```
## Add Dependency
add `driver-go` dependency in `go.mod` .
```go-mod title="go.mod"
{{#include docs/examples/go/connectexample/go.mod}}
```
## Config
Run this command in your terminal to save DSN(data source name) as variable:
```bash
export TDENGINE_GO_DSN=""
```
```bash
set TDENGINE_GO_DSN=""
```
```powershell
$env:TDENGINE_GO_DSN=""
```
:::note
Replace with the real value, the format should be `https()/?token=`.
To obtain the value of `goDSN`, please log in [TDengine Cloud](https://cloud.tdengine.com) and click "Connector" and then select "Go".
:::
## Connect
Copy code bellow to main.go.
```go title="main.go"
{{#include docs/examples/go/connectexample/main.go}}
```
Then download dependencies by execute command:
```
go mod tidy
```
Finally, test the connection:
```
go run main.go
```