我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在go源代码目录中列出导入的模块

Is there an tool or easiest way to list all imported packages on go source code directory? for example:

$ go list_imports a_directory/
github.com/bla/bla
github.com/foo/bar
LOCAL/module/path

Ah found the way..

go list -f '{{join .Deps "
"}}' |  xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}} ' | sort | uniq

近期文章

  • 扫描到无效类型时,Sqlx不引发错误
  • io.copyN在第一次不被调用时无法工作
  • 开始:同时调用方法对我不起作用[重复]
  • 是否可以从模块中将〜/ go / src /导入本地包? [关闭]
  • Seelog Rollingfile文件名模式不符合预期
  • 是否可以嵌入包而不复制它?
  • 带有脚本标签的HTML文件
  • 当我运行docker compose时,我的golang(入口)容器失败,提示“建立Mongo会话时出错”
  • 为什么Go根据我声明缓冲区的位置设置不同的内容类型
  • Golang代码将文件上传到个人邮箱帐户
  • “包_ / home / vitaly:无法识别的导入路径“ _ / home / vitaly”(导入路径不是以主机名开头)”
  • 使用Golang,如何读取2个字符之间的文件内容
  • 识别现有文件夹[重复]
  • 无法通过martini框架访问静态网页index.html
  • 将字符串转换为最合适的类型
  • 如何将JSON数据插入PostgreSQL
  • 如何从Golang的嵌套结构中获取值
  • Go工具中的命令行参数被忽略
  • golang-似乎无法删除http连接
  • 最佳方法,每秒可完成1000个http.Get

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华