Open phst opened 5 years ago
This is also the case for most other Cgo names in C.
If you're fine with renaming all the Cgo identifiers, I can take this.
Renaming all the cgo identifiers seems likely to break existing code. I'm not sure exactly what we can do here.
From skimming https://golang.org/cmd/cgo/, _GoString_
and the associated functions seem to be the only documented ones. I'd suggest we rename them, but provide aliases/forwarding functions marked as deprecated. If we don't care about breakages caused by using the undocumented names, we can just rename them.
Do you happen to have a list of the undocumented names that are invalid according to the C standard?
Unfortunately history tells us that many people write code that refers to undocumented cgo names.
I'm OK with renaming GoString in the docs as long it continues to work in the code.
(Removing the template since this is not really a code bug or so.)
https://golang.org/cmd/cgo/#hdr-Go_references_to_C explains that there's a type
_GoString_
. However, that name is reserved (see https://en.cppreference.com/w/c/language/identifier#Reserved_identifiers), and using it is technically undefined behavior. I'd suggest renaming the type to justGoString
in future versions, with the old name as undocumented and deprecated alias.