1 Star 0 Fork 0

exlimit/tegola

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
debug.go 647 Bytes
一键复制 编辑 原始数据 按行查看 历史
Gautam Dey 提交于 2017-10-24 15:44 . More cleanup.
package plyg
import (
"encoding/gob"
"os"
"github.com/pborman/uuid"
)
func genWriteoutCols(cols ...RingCol) string {
fn := "debug-uuid-" + uuid.New()
WriteoutCols(fn, cols...)
return fn
}
func WriteoutCols(filename string, cols ...RingCol) {
f, err := os.Create(filename)
if err != nil {
panic(err)
}
defer f.Close()
enc := gob.NewEncoder(f)
err = enc.Encode(cols)
if err != nil {
panic(err)
}
}
func LoadCols(filename string) (cols []RingCol) {
f, err := os.Open(filename)
if err != nil {
panic(err)
}
defer f.Close()
dec := gob.NewDecoder(f)
err = dec.Decode(&cols)
if err != nil {
panic(err)
}
return cols
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/exlimit/tegola.git
git@gitee.com:exlimit/tegola.git
exlimit
tegola
tegola
v0.10.2

搜索帮助