Documentation
¶
Overview ¶
Package gen はテンプレートからGoコードを生成します。
このパッケージは以下の処理を順次実行します:
- テンプレートのスキャン (internal/scan)
- 型の解決 (internal/typing)
- Goコードの生成
生成されるコードには、Params構造体、Template関数、Render関数が含まれます。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmitResult ¶
type EmitResult struct {
MainCode string // 型定義とRender関数
SourcesCode string // テンプレート文字列リテラル
Warnings []string // 警告メッセージ
}
EmitResult はコード生成の結果を保持する
func Emit ¶
func Emit(specs []TemplateSpec) (*EmitResult, error)
Emit は複数のテンプレートから2つの統合Goファイルを生成する 単一テンプレートの場合も同じフォーマットで生成される
Click to show internal directories.
Click to hide internal directories.