1. 首页
  2. 考试认证
  3. 其它
  4. GoPaths高效Go包索引工具指南

GoPaths高效Go包索引工具指南

上传者: 2024-11-07 18:11:29上传 ZIP文件 10.74KB 热度 37次

GoPaths 是一个Go包索引器,可用于在 GOROOTGOPATH 目录中搜索 Go包。通过该工具,您可以使用完整路径来响应较短的包路径,适合与 cdgodoc 命令结合使用,从而提高开发效率。

安装


$ go get github.com/pietv/gopaths  

$ go install github.com/pietv/gopaths  

使用方法

  1. 启动服务

$ gopaths -http=:6118 &  

  1. 搜索包

使用以下命令来搜索特定包路径:


$ curl :6118/imports/log  

google.golang.org/appengine/internal/log  

google.golang.org/appengine/log  

  1. 搜索包含包的目录

查找包含指定包的目录路径:


$ curl :6118/dirs/rand  

/Users/peter/go/src/crypto/rand  

/Users/peter/go/src/  

下载地址
用户评论