---
title: "Go Get"
description: "Installing the TraceRTM Go SDK with go get and managing versions"
---

# Go Get

Install and manage the TraceRTM Go SDK using Go's built-in package manager.

## Basic Installation

### Install Latest Stable

```bash
go get github.com/tracertm/tracertm-go
```

This installs:
- The latest stable version
- All required dependencies
- Type definitions

### Install Specific Version

```bash
# Install specific version
go get github.com/tracertm/tracertm-go@v1.2.3

# Install latest minor version in v1.x
go get github.com/tracertm/tracertm-go@v1

# Install latest patch in v1.2.x
go get github.com/tracertm/tracertm-go@v1.2
```

### Install Latest Development

```bash
# Latest commit on main branch
go get github.com/tracertm/tracertm-go@latest

# Specific commit
go get github.com/tracertm/tracertm-go@abc1234

# Specific branch
go get github.com/tracertm/tracertm-go@feature-branch
```

---

## Version Management

### Check Installed Version

```bash
go list -m github.com/tracertm/tracertm-go
```

Output:
```
github.com/tracertm/tracertm-go v1.2.3
```

### List Available Versions

```bash
go list -m -versions github.com/tracertm/tracertm-go
```

Output:
```
github.com/tracertm/tracertm-go v1.0.0 v1.0.1 v1.1.0 v1.2.0 v1.2.1 v1.2.2 v1.2.3
```

### Upgrade to Latest

```bash
go get -u github.com/tracertm/tracertm-go
```

### Upgrade All Dependencies

```bash
go get -u ./...
```

### Downgrade Version

```bash
go get github.com/tracertm/tracertm-go@v1.1.0
```

---

## go.mod Management

### Initial Setup

```bash
# Create new module
go mod init myproject

# Add SDK dependency
go get github.com/tracertm/tracertm-go
```

### go.mod File

After installation, your `go.mod` looks like:

```go
module myproject

go 1.21

require github.com/tracertm/tracertm-go v1.2.3
```

### Version Constraints

Use version constraints in `go.mod`:

```go
module myproject

go 1.21

require (
    // Exact version
    github.com/tracertm/tracertm-go v1.2.3
)
```

### Indirect Dependencies

The SDK's dependencies appear as indirect:

```go
require (
    github.com/tracertm/tracertm-go v1.2.3
)

require (
    golang.org/x/net v0.18.0 // indirect
)
```

---

## Workspace Mode

### Multi-Module Workspace

For projects with multiple modules:

```bash
# Create workspace
go work init

# Add modules
go work use ./main-app
go work use ./shared-lib

# Install SDK in specific module
cd main-app && go get github.com/tracertm/tracertm-go
```

### go.work File

```go
go 1.21

use (
    ./main-app
    ./shared-lib
)
```

---

## Vendoring

### Create Vendor Directory

```bash
go mod vendor
```

### Build with Vendor

```bash
go build -mod=vendor ./...
```

### Update Vendor

```bash
go mod tidy
go mod vendor
```

---

## Private Modules

### GOPRIVATE Setting

If using a private fork:

```bash
export GOPRIVATE=github.com/yourorg/*
go get github.com/yourorg/tracertm-go
```

### .netrc Authentication

For private repositories:

```
machine github.com
login YOUR_USERNAME
password YOUR_TOKEN
```

---

## Proxy Configuration

### Default Proxy

```bash
export GOPROXY=https://proxy.golang.org,direct
```

### Corporate Proxy

```bash
export GOPROXY=https://goproxy.yourcompany.com,direct
export GONOSUMDB=github.com/yourorg/*
```

### No Proxy (Direct)

```bash
export GOPROXY=direct
```

---

## Cache Management

### View Module Cache

```bash
go env GOMODCACHE
# Typically: ~/go/pkg/mod
```

### Clear Module Cache

```bash
go clean -modcache
```

### Clear Build Cache

```bash
go clean -cache
```

### Clear Everything

```bash
go clean -modcache -cache
```

---

## Troubleshooting

### Module Not Found

```
go: module github.com/tracertm/tracertm-go: reading https://...: 404 Not Found
```

**Solutions**:

```bash
# Verify module exists
curl -I https://proxy.golang.org/github.com/tracertm/tracertm-go/@v/list

# Try direct fetch
GOPROXY=direct go get github.com/tracertm/tracertm-go
```

### Checksum Mismatch

```
go: github.com/tracertm/tracertm-go@v1.2.3: verifying go.sum: checksum mismatch
```

**Solutions**:

```bash
# Clear go.sum and regenerate
rm go.sum
go mod tidy
```

### Version Conflict

```
go: finding module for package github.com/tracertm/tracertm-go
go: found github.com/tracertm/tracertm-go in github.com/tracertm/tracertm-go v1.2.3
```

**Solutions**:

```bash
# Check version requirements
go mod graph | grep tracertm

# Force specific version
go get github.com/tracertm/tracertm-go@v1.2.3
go mod tidy
```

### Authentication Issues

```
go: module github.com/tracertm/tracertm-go: git ls-remote: exit status 128
```

**Solutions**:

```bash
# Check Git configuration
git config --global url."https://".insteadOf git://

# Or use SSH
git config --global url."git@github.com:".insteadOf "https://github.com/"
```

---

## Best Practices

### 1. Pin Versions

```go
// go.mod
require github.com/tracertm/tracertm-go v1.2.3
```

### 2. Regular Updates

```bash
# Check for updates regularly
go list -m -u github.com/tracertm/tracertm-go

# Update with testing
go get -u github.com/tracertm/tracertm-go
go test ./...
```

### 3. Use go mod tidy

```bash
# Keep dependencies clean
go mod tidy
```

### 4. Commit go.sum

Always commit both `go.mod` and `go.sum` to version control.

---

## CI/CD Integration

### GitHub Actions

```yaml
- name: Install Dependencies
  run: |
    go mod download
    go mod verify

- name: Build
  run: go build -v ./...
```

### GitLab CI

```yaml
build:
  script:
    - go mod download
    - go build -v ./...
```

### Jenkins

```groovy
stage('Dependencies') {
    sh 'go mod download'
    sh 'go mod verify'
}
```

---

## Related Documentation

- [Installation](/docs/api-reference/sdks/go/installation) - Full installation guide
- [Version Requirements](/docs/api-reference/sdks/go/version-requirements) - Go version requirements
- [Quick Start](/docs/api-reference/sdks/go/quickstart) - Get started
