# Go SDK (https://docs.getaviato.com/integrations/go)



The Go SDK lives in the `github.com/getaviato/aviato-go` module and requires Go 1.25 or newer. Use a published release compatible with your agent; the monorepo implementation is in [packages/sdk-go](https://github.com/getaviato/aviato/tree/master/packages/sdk-go).

## Create and mount a plugin [#create-and-mount-a-plugin]

```go
package main

import (
    "context"
    "log"
    "net/http"
    "os"

    aviato "github.com/getaviato/aviato-go"
)

func main() {
    plugin := aviato.MustNew(aviato.Options{
        Secret: os.Getenv("AVIATO_PLUGIN_SECRET"),
        BasePath: "/aviato",
    })
    plugin.Action("customers", "Confirm selection", aviato.ScopeSingle,
        func(ctx context.Context, action *aviato.ActionContext) (aviato.Result, error) {
            if _, err := action.Records(ctx); err != nil {
                return nil, err
            }
            return action.Success("Customer selected", "customers"), nil
        })
    http.Handle("/aviato/", plugin.Handler())
    log.Fatal(http.ListenAndServe(":4100", nil))
}
```

Configure `AVIATO_PLUGIN_URL` and `AVIATO_PLUGIN_SECRET` on the agent, using the same secret as your Go process. Terminate HTTPS in front of your service when it is exposed outside a trusted network.

## Framework adapters [#framework-adapters]

The SDK includes Gin and Echo adapters. The [Gin fixture](https://github.com/getaviato/aviato/tree/master/packages/fixtures/gin) demonstrates actions and custom datasources exercised by protocol conformance tests.

## Test your handlers [#test-your-handlers]

Use the `aviatotest` harness for local handler tests with a fake caller and seeded Data API. Test both the returned action result and changes made through the Data API. See the [SDK README](https://github.com/getaviato/aviato/blob/master/packages/sdk-go/README.md) for the harness API.
