【文件属性】:
文件名称:gotemplate:用于生成类型和函数的模板实例化的 golang 预处理器
文件大小:7KB
文件格式:ZIP
更新时间:2021-06-21 13:03:40
Go
模板
用于生成类型和函数的模板实例的 golang 预处理器
安装
go get -u github.com/redefiance/gotemplate
例子
在您的项目目录中创建一个 .go 文件,例如CircularBuffer.go :
// +gotemplate
package main
type CircularBuffer_T struct {
data [] T
curPos int
}
func newCircularBuffer_T ( size int ) {
return CircularBuffer_T { data : make ([] T , size )}
}
func ( b CircularBuffer_T ) Push ( value T ) {
b . curPos ++
if b . curPos >= len ( b . da
【文件预览】:
gotemplate-master
----main.go(800B)
----Package.go(2KB)
----File.go(3KB)
----example()
--------main.go(294B)
--------Observable_impl.go(1KB)
--------Observable.go(1KB)
----README.md(2KB)
----Template.go(2KB)
----References.go(986B)