3 ms·
We're provided with some nice fake type signatures for such builtin functions in the godoc: https://golang.org/pkg/builtin/#copy https://golang.org/pkg/builtin
by frou_dh 8y ago
We're provided with some nice fake type signatures for such builtin functions in the godoc:
https://golang.org/pkg/builtin/#copy https://golang.org/pkg/builtin/#copy
https://golang.org/pkg/builtin/#Type https://golang.org/pkg/builtin/#Type
- vorg 8y agoIf Go 2 is bringing us generics, then couldn't that `builtin` package provide real type signatures for the builtin functions instead of fake ones? Instead of func delete(m map[Type]Type1, key Type) it could have func Delete(type Type, Type1 somecontract) (m map[Type]Type1, key Type) in there, and a program compiled with Go 2 would have an implied instance of func delete = builtin.Delete(T, U) in its global namespace for every map with a `delete` used somewhere in the code.