---
title: Examples
description: Complete Go examples for LiteSVM
---

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`.

<Cards>
  <Card
    title="SOL Transfer"
    description="Build and send a system-program transfer"
    href="/docs/tools/litesvm/go/examples/sol-transfer"
  />
  <Card
    title="Account Setup"
    description="Seed test accounts and program data state"
    href="/docs/tools/litesvm/go/examples/account-setup"
  />
  <Card
    title="Program Testing"
    description="Load and exercise custom SBF programs"
    href="/docs/tools/litesvm/go/examples/program-testing"
  />
  <Card
    title="Time-Based Testing"
    description="Test time-dependent logic with WarpToSlot / SetClock"
    href="/docs/tools/litesvm/go/examples/time-based"
  />
</Cards>

## Running Examples

```bash
# 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`](https://github.com/LiteSVM/litesvm-go/blob/main/examples/transfer/main.go)
in the `litesvm-go` repo.
