我正在Hugo使用Travis-Ci. 最近(大约 3 天内)发生错误:$ go get github.com/gohugoio/hugo# github.com/gohugoio/hugo/tpl/internal/go_templates/fmtsort../../gohugoio/hugo/tpl/internal/go_templates/fmtsort/sort.go:58:18: mapValue.MapRange undefined (type reflect.Value has no field or method MapRange)The command "go get github.com/gohugoio/hugo" failed and exited with 2 during .由于代码go get在行出错,我认为它一定是由Hugo..travis.ymlsudo: falselanguage: gogit: depth: 1install: - go get github.com/gohugoio/hugoscript: - git submodule init - git submodule update - hugo # Deploy to GitHub pagesdeploy: provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: public on: branch: master
1 回答

慕田峪7331174
TA贡献1828条经验 获得超13个赞
从 Hugo 0.48 开始,Hugo 使用 Go 1.11 内置的 Go Modules 支持来构建。
docker run -it golang:1.10
root@2598ed7e489d: 去获取 github.com/gohugoio/hugo
src/github.com/gohugoio/hugo/tpl/internal/go_templates/fmtsort/sort.go:58:18: mapValue.MapRange 未定义(类型 reflect.Value 没有字段或方法 MapRange)docker run -it golang:1.11
root@07e6e634656a: go get https://github.com/gohugoio/hugo
不会返回任何错误
使用 go 版本 > 1.11 不会导致此问题。
在示例 1 中,存在类似的错误。
在示例 2 中,它已成功安装。
- 1 回答
- 0 关注
- 195 浏览
添加回答
举报
0/150
提交
取消