亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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 關注
  • 145 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號