サンプル集

litesvm-go の使い方を示す、完全で実行可能なサンプル集です。各サンプルは自己完結型の Go テストとして作成されており、パッケージに追加して go test で実行できます。

サンプルの実行方法

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

Alpine / musl 環境では、適切なベンダーアーカイブがリンクされるよう、go test の実行時に -tags musl を追加してください。

スタンドアロンのコマンドラインサンプル(テストランナーなし)については、litesvm-go リポジトリ内の examples/transfer/main.go をご参照ください。

Is this page helpful?

目次

ページを編集
© 2026 Solana Foundation. 無断転載を禁じます。