英文:
GO support for building CLI tools using native system shell
问题
我计划使用GO语言构建一个在本地系统shell中执行而不是单独的shell的CLI工具。除了codegangsta/cli之外,还有哪些GO语言包可以用于此目的?
此外,GO语言中是否有支持REST API调用(例如curl)的包?
英文:
I am planning to use GO to build a CLI tool executed in native system shell rather than a separate shell.
What packages for GO can be used for this purpose other than codegangsta/cli ?
Additionally,
Is there any package to get REST API call support (such as curl)
in GO?
答案1
得分: 0
curl
在Go语言中有一个有趣的实现,使用了astaxie/bat
。
> Bat是一个为人类设计的用于测试、调试和与HTTP服务器进行交互的类似cURL的命令行工具。
这意味着你需要实现一个REST服务器,以便任何类似cURL的工具可以与之交互。
可以参考"在Go中创建一个RESTful JSON API"进行实现。
英文:
curl
has an interesting implementation in Go with astaxie/bat
> Go implemented CLI cURL-like tool for humans. Bat can be used for testing, debugging, and generally interacting with HTTP servers.
That means you needs to implement your REST server in order for any curl-like tool to interact with it.
See for instance "Making a RESTful JSON API in Go".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论