如何提取Go语言内置函数的代码,例如delete()函数?

huangapple go评论145阅读模式
英文:

How to extract go builtin function code such as delete()

问题

我在Go的源代码(/go/src/builtin/builtin.go)中找到了内置函数,如下所示:

func delete(m map[Type]Type1, key Type)

但这不是源代码。谁能告诉我内置函数的源代码在哪里?

英文:

I have found the builtin function in go src (/go/src/builtin/builtin.go), as following:

func delete(m map[Type]Type1, key Type)

But this is not source code. Who can tell me where is the builtin function source code?

答案1

得分: 7

builtin.go只是一个用于文档目的的文件,它不包含任何实现。

map的实现在runtime/map.go中。删除功能是在mapdelete函数中实现的。

英文:

builtin.go is simply a file for documentation purposes. It doesn't contain any implementations.

The map implementation is in runtime/map.go. The delete functionality is implemented in the mapdelete function.

huangapple
  • 本文由 发表于 2016年1月5日 23:03:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/34614794.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定