我每 10 秒拉一次存储库,并且需要检查每次拉后哪些文件发生了更改。
可以用 go-git 做到这一点吗?
我正在尝试找到转换的最佳方法
map[string]string键入字符串。我尝试使用marshall转换为json以保留格式,然后转换回字符串,但这未成功。更具体地说,我正在尝试将包含键和值的映射转换为字符串以容纳https://www.nomadproject.io/docs/job-specification/template.html#environment-variables https://github.com/hashicorp /nomad/blob/master/nomad/structs/structs.go#L3647
例如,最后一个字符串应该像
LOG_LEVEL="x"
API_KEY="y"
Run Code Online (Sandbox Code Playgroud)
地图
m := map[string]string{
"LOG_LEVEL": "x",
"API_KEY": "y",
}
Run Code Online (Sandbox Code Playgroud)