【发布时间】:2019-07-26 13:04:31
【问题描述】:
我正在尝试从我的 template.go 文件中运行以下命令:
//go:generate gotext -srclang=en update -out=catalog.go -lang=en,de_DE,es_MX,fr_CA,pt_BR
我应该会生成一个 catalog.go,但我却收到以下错误:
gotext: extract failed: pipeline: golang.org/x/text/message is not imported
template.go:3: running "gotext": exit status 1
我在生成命令后的template.go 中确实有以下导入:
import (
"time"
log "github.com/sirupsen/logrus"
"golang.org/x/text/message"
)
我尝试在 generate 命令之前移动导入。我还尝试从项目的根目录中运行generate ./...。我也试过自己运行gotext,但还是同样的错误信息。
我还在 github 上找到了以下线程: https://github.com/golang/go/issues/26312 我已经尝试了那里的建议,但似乎也没有解决问题。
【问题讨论】:
标签: go localization translation