Go标准库API


  • API Application Programming Interface,应用程序编程接口)是 Golang 提供的基本编程接口。
  • Go 语言提供了大量的标准库,因此 google 公司 也为这些标准库提供了相应的 API 文档,用于告诉开发者如何使用这些标准库,以及标准库包含的方法。

Go标准库API

Go标准库API

  • 点击fmt,进入如下页面

Go标准库API

  • 向下翻,找到index,这里查看我们需要的内容,然后点击进入,

Go标准库API

  • 比如查询Println,点击链接,则进入

Go标准库API


Golang 的包和源文件和函数

  • 先找到Go安装目录下的src

Go标准库API

  • 找到包的文件夹,如fmt

Go标准库API

  • 相当于参考网站目录下的fmt

Go标准库API

  • 点进fmt包,查看源代码

Go标准库API

  • 点击一个文件查看源码,如点击print.go

Go标准库API

  • 如想查看Println函数源码,Ctrl + F,搜寻Println,发现调用Fprintln,再次搜索Fprintln,结果如下:

Go标准库API

Go标准库API


  • Golang 的包和源文件和函数的关系简图

Go标准库API

相关文章:

  • 2021-09-11
  • 2022-01-18
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2021-11-21
  • 2021-12-18
  • 2021-11-20
猜你喜欢
  • 2021-11-13
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-06-05
  • 2021-09-24
相关资源
相似解决方案