gpt4 book ai didi

go - 如何在 GO 中导出所有包 API 名称

转载 作者:IT王子 更新时间:2023-10-29 02:00:24 27 4
gpt4 key购买 nike

导出为api.txt文件,如

fmt.Println(params...)
net.LookupIP(params...)
...

逐行

我用它来 IDE 自动完成

最佳答案

正如其他人所说,gocode 很可能已经完成了您想要的操作。但无论如何,要列出包的导出 API,您可以使用 go tool api <pkg> .例如

$ go tool api runtime | grep func

pkg runtime, func Breakpoint()
pkg runtime, func CPUProfile() []byte
pkg runtime, func Caller(int) (uintptr, string, int, bool)
pkg runtime, func Callers(int, []uintptr) int
pkg runtime, func FuncForPC(uintptr) *Func
pkg runtime, func GC()
...

关于go - 如何在 GO 中导出所有包 API 名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10577707/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com