猿问

命令“go get github.com/gohugoio/hugo”失败并在期间以 2 退出

我正在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.yml


sudo: false


language: go


git:

  depth: 1


install: 

  - go get github.com/gohugoio/hugo


script:

  - git submodule init

  - git submodule update

  - hugo


  # Deploy to GitHub pages

deploy:

  provider: pages

  skip_cleanup: true

  github_token: $GITHUB_TOKEN

  local_dir: public

  on:

    branch: master



千巷猫影
浏览 196回答 1
1回答

慕田峪7331174

从 Hugo 0.48 开始,Hugo 使用 Go 1.11 内置的 Go Modules 支持来构建。docker run -it golang:1.10root@2598ed7e489d: 去获取 github.com/gohugoio/hugosrc/github.com/gohugoio/hugo/tpl/internal/go_templates/fmtsort/sort.go:58:18: mapValue.MapRange 未定义(类型 reflect.Value 没有字段或方法 MapRange)docker run -it golang:1.11root@07e6e634656a: go get https://github.com/gohugoio/hugo不会返回任何错误使用 go 版本 > 1.11 不会导致此问题。在示例 1 中,存在类似的错误。在示例 2 中,它已成功安装。
随时随地看视频慕课网APP

相关分类

Go
我要回答