Examples

Complete, runnable examples demonstrating litesvm-go. Each example is a self-contained Go test you can drop into a package and run with go test.

Running Examples

# 1) Initialize a Go module (skip if you already have a go.mod)
go mod init mytest
# 2) Add the dependencies to your Go project
go get github.com/LiteSVM/litesvm-go
go get github.com/gagliardetto/solana-go
# 3) Drop an example into a _test.go file and run
go test ./...

On Alpine / musl, add -tags musl to your go test invocation so the right vendored archive is linked.

For a standalone command-line example (no test runner), see examples/transfer/main.go in the litesvm-go repo.

Is this page helpful?

Inhoudsopgave

Pagina Bewerken
© 2026 Solana Foundation. Alle rechten voorbehouden.
Examples | Solana