为了账号安全,请及时绑定邮箱和手机立即绑定

go 如何知道从哪里获取包

go 如何知道从哪里获取包

Go
炎炎设计 2023-06-19 16:53:42
当我在 go 应用程序中导入包时(使用模块和带有 golang 插件的 vscode):import (    cors "goa.design/plugins/cors/dsl")go 自动检索包。go 如何知道从哪里得到它?我认为它只是从 github.com 中提取源代码,但该项目的存储库名称中https://github.com/goadesign/goa没有。.如果我将导入更改为:import (    cors "goa.design/plugins/v3/cors/dsl")它检索v3包。我很乐意使用 RTFM,但不确定我需要阅读哪个 FM。顺便说一句:这是我的第二天,go所以这对我来说很神奇。
查看完整描述

1 回答

?
沧海一幻觉

TA贡献1824条经验 获得超5个赞

很简单,看一下:


$> curl https://goa.design/plugins/cors/dsl

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

  <meta http-equiv="content-type" content="text/html; charset=utf-8">



  <meta name="go-import" content="goa.design/plugins git https://github.com/goadesign/plugins">

  <meta name="go-source" content="goa.design/plugins _ https://github.com/goadesign/plugins/tree/master/{/dir} https://github.com/goadesign/plugins/blob/master{/dir}/{file}#L{line}">

这里的关键在名为“go-import”的标签中。


查看完整回答
反对 回复 2023-06-19
  • 1 回答
  • 0 关注
  • 88 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信