命令“ go get github.com/gohugoio/hugo”失败,并在过程中以2退出

问题描述 投票:0回答:1

我正在使用Hugo构建网站并使用Travis-Ci进行部署。最近发生了错误:

$ 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 .

。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

无法像这样在Google上找不到任何东西。

go travis-ci hugo
1个回答
1
投票

自Hugo 0.48起,Hugo使用Go 1.11中内置的Go模块支持。

  • 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:转到https://github.com/gohugoio/hugo不会返回任何错误

使用Go版本> 1.11不会导致此问题。在示例1中,存在类似的错误。在示例2中,它已成功安装。

© www.soinside.com 2019 - 2024. All rights reserved.