Go自定义导入,无法识别的导入路径,无导入元标签

huangapple go评论85阅读模式
英文:

Go vanity imports, unrecognized import path, no-import meta tags

问题

go 抱怨 meta 标签不存在,但实际上它们是存在的。

go version go1.14.15 linux/amd64

curl "https://go.mis.vision/mis-utils?go-get=1"

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>go.mis.vision/mis-utils</title>
<meta name="go-import" content="go.mis.vision/mis-utils  ssh://git@ssh.dev.azure.com:v3/somewhere">
<meta name="go-source" content="go.mis.vision/mis-utils _ _ _">
<style>
* { font-family: sans-serif; }
body { margin-top: 0; }
.content { display: inline-block; }
code { display: block; font-family: monospace; font-size: 1em; background-color: #d5d5d5; padding: 1em; margin-bottom: 16px; }
ul { margin-top: 16px; margin-bottom: 16px; }
</style>
</head>
<body>
<div class="content">
<h2>go.mis.vision/mis-utils</h2>
<code>go get go.mis.vision/mis-utils</code>
<code>import "go.mis.vision/mis-utils"</code>
Home: <a href="https://godoc.org/go.mis.vision/mis-utils">https://godoc.org/go.mis.vision/mis-utils</a><br/>
Source: <a href="#ZgotmplZ">ssh://git@ssh.dev.azure.com:v3/somewhere</a><br/>
</div>
</body>
</html>

go get go.mis.vision/mis-utils

go: go.mis.vision/mis-utils@v1.0.1: 无法识别的导入路径 "go.mis.vision/mis-utils": 解析 https://go.mis.vision/mis-utils?go-get=1 时没有找到 go-import meta 标签 ()

我错过了什么?

英文:

go is complaining that meta-tags don't exist, when they do.

➜ go version                    
go version go1.14.15 linux/amd64
➜ curl &quot;https://go.mis.vision/mis-utils?go-get=1&quot;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;go.mis.vision/mis-utils&lt;/title&gt;
&lt;meta name=&quot;go-import&quot; content=&quot;go.mis.vision/mis-utils  ssh://git@ssh.dev.azure.com:v3/somewhere&quot;&gt;
&lt;meta name=&quot;go-source&quot; content=&quot;go.mis.vision/mis-utils _ _ _&quot;&gt;
&lt;style&gt;
* { font-family: sans-serif; }
body { margin-top: 0; }
.content { display: inline-block; }
code { display: block; font-family: monospace; font-size: 1em; background-color: #d5d5d5; padding: 1em; margin-bottom: 16px; }
ul { margin-top: 16px; margin-bottom: 16px; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;h2&gt;go.mis.vision/mis-utils&lt;/h2&gt;
&lt;code&gt;go get go.mis.vision/mis-utils&lt;/code&gt;
&lt;code&gt;import &quot;go.mis.vision/mis-utils&quot;&lt;/code&gt;
Home: &lt;a href=&quot;https://godoc.org/go.mis.vision/mis-utils&quot;&gt;https://godoc.org/go.mis.vision/mis-utils&lt;/a&gt;&lt;br/&gt;
Source: &lt;a href=&quot;#ZgotmplZ&quot;&gt;ssh://git@ssh.dev.azure.com:v3/somewhere&lt;/a&gt;&lt;br/&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
➜ go get go.mis.vision/mis-utils
go: go.mis.vision/mis-utils@v1.0.1: unrecognized import path &quot;go.mis.vision/mis-utils&quot;: parse https://go.mis.vision/mis-utils?go-get=1: no go-import meta tags ()

What am I missing?

答案1

得分: 2

在vanity配置中为仓库指定额外的参数:"VCS": "git"

英文:

specify additional parameter for the repo in vanity config: &quot;VCS&quot;: &quot;git&quot;

答案2

得分: 1

原来,vangen生成的go-import格式是无效的。

正确的格式应该是:go.mis.vision/mis-utils git ssh://git@ssh.dev.azure.com/v3/somewhere

英文:

Turns out, vangen was producing an invalid go-import format.

It should be: go.mis.vision/mis-utils git ssh://git@ssh.dev.azure.com/v3/somewhere

huangapple
  • 本文由 发表于 2022年1月21日 01:20:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/70790641.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定