Skip to main content

Requirements

  • Go 1.21 or higher
  • Go modules enabled (default in Go 1.16+)

Install via go get

The easiest way to install the Switchport SDK is using go get:

Add to go.mod

Alternatively, add it directly to your go.mod file:
Then run:

Verify Installation

Verify that the SDK is installed correctly:

Dependencies

The Switchport Go SDK has zero external dependencies - it uses only the Go standard library:
  • net/http - For HTTP requests to the Switchport API
  • encoding/json - For JSON encoding/decoding
  • time - For timestamp handling
  • errors - For error handling
This minimal dependency footprint ensures compatibility and reduces the risk of dependency conflicts.

Upgrading

To upgrade to the latest version:
Or update to a specific version:

Using with Go Workspaces

If you’re using Go workspaces (Go 1.18+), the SDK works seamlessly:

Troubleshooting

Module Cache Issues

If you encounter module cache issues, try clearing the cache:

Go Version Issues

Make sure you’re using Go 1.21 or higher:
If you need to update Go, visit go.dev/dl.

Import Path Issues

Make sure you’re importing from the correct path:
Note the /switchport subpackage at the end.

Next Steps

Authentication

Set up your API key and authenticate