github.com/solana-foundation/solana-go/v2. The repository moved from
gagliardetto/solana-go; v1 keeps the github.com/gagliardetto/solana-go
module path.
If you’re using Anchor for your Solana programs,
anchor-go generates a Go client
from your IDL. The code it generates imports the v1 module
(github.com/gagliardetto/solana-go), not v2.
Installation
The latest v2 release needs Go 1.26 or later. Add the SDK to your module (rungo mod init <module name> first in a new folder):
Terminal
github.com/solana-foundation/solana-go/v2/rpc, run go mod tidy to record
their dependencies. The cookbook’s Go examples are tested with v2.2.0.