Cgo translates C types into equivalent unexported Go types.
https://golang.org/cmd/cgo/

Peter

On Thursday, April 18, 2019 at 2:25:11 AM UTC-4, dja...@gmail.com wrote:
>
> Hi,
> where is documented that methods can be created on C types ?
>
> This works with go1.12.4, linux:
> https://play.golang.org/p/gXpHCFOgDDg
>
> package main
>
> import (
>     "C"
>     "fmt"
> )
>
> func (i *C.int) Inc() {
>     *i++
> }
>
> func main() {
>     var i C.int
>     i.Inc()
>     fmt.Println(i)
> }
>
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to