1 Star 0 Fork 0

半盏时光 / apptemplate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
apptemplate.go 671 Bytes
一键复制 编辑 原始数据 按行查看 历史
半盏时光 提交于 2021-09-18 08:39 . update apptemplate.go.
package apptemplate
import (
"fmt"
"io/ioutil"
"os"
)
func ReadParam(paramFileName string) (string, error) {
file, err := ioutil.ReadFile(paramFileName + ".json")
params := string(file[:])
return params, err
}
func WriteResult(resultFileName string, output []byte) {
err := ioutil.WriteFile(resultFileName, output, os.ModeType)
if err != nil {
fmt.Println("写入失败,err=", err)
} else {
fmt.Println("写入成功")
}
}
func Usage(commandName string, actionId string) {
fmt.Printf("example: %s.go %s test", commandName, actionId)
}
func Args() (string, string) {
var actionId = os.Args[1]
var filename = os.Args[2]
return actionId, filename
}
Go
1
https://gitee.com/venustrance/apptemplate.git
git@gitee.com:venustrance/apptemplate.git
venustrance
apptemplate
apptemplate
v0.1.0

搜索帮助