this is bug 10715: https://github.com/golang/go/issues/10715
a more idiomatic solution is available here:
https://github.com/golang/go/blob/master/misc/cgo/stdio/stdio.go
On Sun, Jul 31, 2016 at 1:22 AM, P Q wrote:
> https://play.golang.org/p/4XZSmyRkZa
>
> I've got
there are a few problems with your project as presented:
- your .c file has a (mistyped) directive to not build on linux on
line 1: "/ build !linux". this needs to go
- your a_non_linux.go file is not idiomatic. it makes much more sense
to specialize the linux code in a separate file and leave
> @all, thanks for the explanation!
in my view, all the "details" come from reasoning about Go through the
sieve of other programming languages. nothing wrong in doing that, as
long as the original intention is understood. for me, Go will always
be looked through the sieve of C, in particular the
If the library made no provision for the caller to give a unique token
which would help to identify it in the callback then that library does
not expect to have more than one caller-and-callback in play at any
one time, or, even worse, expects you to arrange some thread-local
storage in the caller
201 - 204 of 204 matches
Mail list logo