You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Go编写的CLI工具分发失败:go install安装报错及问题排查问询

Go install error: module found but does not contain target package

I'm trying to publish a CLI tool written in Go, but when I run the installation command go install github.com/myuser/mytool@latest, I get this error:

go install: github.com/myuser/mytool@latest: module github.com/myuser/mytool@latest found (v0.0.1), but does not contain package github.com/myuser/mytool

Here's what I've already done:

  • Created a v0.0.1 version tag and uploaded the binary files for release
  • Ran go get -u github.com/myuser/mytool, but the command produced no output and the tool still wasn't installed

Additional Details

Go Version

go version go1.17.2 darwin/arm64

go.mod Content

module github.com/myuser/mytool
go 1.17

require github.com/fatih/color v1.13.0

require (
	github.com/mattn/go-colorable v0.1.11 // indirect
	github.com/mattn/go-isatty v0.0.14 // indirect
	golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1 // indirect
)

Note: I can successfully install other Go CLI tools from GitHub using the same go install method. I'm wondering what configuration or steps I might have missed to get my own tool working?

内容的提问来源于stack exchange,提问作者kaneda

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.01 02:17:29