Go Wiki:GoGenerateTools
go generate
僅在您有工具可與其搭配使用時才實用!以下是產生程式碼的有用工具的不完整清單。
- goyacc – Yacc for Go。
- stringer – 為列舉實作
fmt.Stringer
介面。 - gostringer – 為列舉實作
fmt.GoStringer
介面。 - jsonenums – 為列舉實作
json.Marshaler
和json.Unmarshaler
介面。 - go-syncmap - 使用套件作為
sync.Map
的通用範本產生 Go 程式碼。 - go-syncpool - 使用套件作為
sync.Pool
的通用範本產生 Go 程式碼。 - go-atomicvalue - 使用套件作為
atomic.Value
的通用範本產生 Go 程式碼。 - go-nulljson - 使用套件作為實作
database/sql.Scanner
和database/sql/driver.Valuer
的通用範本產生 Go 程式碼。 - go-enum - 使用套件作為實作列舉的介面
fmt.Stringer
|binary
|json
|text
|sql
|yaml
的通用範本產生 Go 程式碼。 - enumer - 產生將 Go 列舉轉換為字串或從字串轉換為 Go 列舉的 Go 程式碼。
- go-import — 自動匯入非 go 檔案。
- gojson - 從範例 json 文件產生 go 結構定義。
- vfsgen - 產生一個 vfsdata.go 檔案,靜態實作指定的虛擬檔案系統。
- goreuse - 使用一個套件作為通用範本,透過替換定義來產生 Go 程式碼。
- embedfiles - 將檔案嵌入到 Go 程式碼中。
- ragel - 狀態機編譯器
- peachpy - 嵌入在 Python 中的 x86-64 組合語言,產生 Go 組合語言
- bundle - Bundle 建立一個單一來源檔案版本的來源套件,適合包含在特定的目標套件中。
- msgp - MessagePack 的 Go 程式碼產生器
- protobuf - protobuf
- thriftrw - thrift
- gogen-avro - avro
- swagger-gen-types - 從 swagger 規格產生 go 類型
- avo - 用 Go 產生組譯碼
- Wire - Go 的編譯時依賴注入
- sumgen - 從和類型宣告產生介面方法實作
- interface-extractor - 產生所需類型介面,僅限於套件內使用的函式。
- deep-copy - 為給定類型建立深度複製函式。
- libfsm - fsm 工具組,支援 (包括但不限於) Go 和 Go 風格 amd64 組合語言,用於比對正規表示式
- re2c - C、C++ 和 Go 的詞法分析器產生器
- re2dfa - 將正規表示式轉換成有限狀態機,並輸出 Go 原始碼
- pigeon - Go 的 PEG 剖析器產生器
此內容為 Go Wiki 的一部分。