> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# 示例

> LiteSVM 的完整 Go 示例

以下是演示 `litesvm-go` 用法的完整、可运行示例。每个示例都是独立的
Go 测试，可直接放入某个包中，并通过 `go test` 运行。

<Columns cols={2}>
  <Card title="SOL 转账" href="/developers/docs/tools/litesvm/go/examples/sol-transfer">
    构建并发送 System Program 转账交易
  </Card>
  <Card title="账户设置" href="/developers/docs/tools/litesvm/go/examples/account-setup">
    预置测试账户和程序数据状态
  </Card>
  <Card title="程序测试" href="/developers/docs/tools/litesvm/go/examples/program-testing">
    加载并运行自定义 SBF 程序
  </Card>
  <Card title="基于时间的测试" href="/developers/docs/tools/litesvm/go/examples/time-based">
    使用 WarpToSlot / SetClock 测试与时间相关的逻辑
  </Card>
</Columns>

## 运行示例

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

`litesvm-go` v0.3.0 及更高版本需要 Go 1.25.7+，并且是纯 Go 实现，
因此无需额外的构建标签或工具链。

如需独立的命令行示例（无需测试运行器），请参阅 `litesvm-go` 仓库中的
[`examples/transfer/main.go`](https://github.com/LiteSVM/litesvm-go/blob/main/examples/transfer/main.go)。
