[go-nuts] Re: how could i embed harfbuzz library source into go package

2019-12-14 Thread aihui zhu
Problem solved, thanks. I created a harfbuzz.cc inside the go package directory, it contains only one line #include "harfbuzz/src/harfbuzz.cc" and then change the cgo header to: /* #cgo CFLAGS: -Iharfbuzz/src #cgo CXXFLAGS: -std=c++11 #cgo LDFLAGS: -lstdc++ #include #include "hb.h"

[go-nuts] how could i embed harfbuzz library source into go package

2019-12-14 Thread aihui zhu
I'm trying to embed the harfbuzz(http://github.com/harfbuzz/harfbuzz) library source code into go package, just like what the glfw(http://github.com/go-gl/glfw) library does. The difference is that glfw contains only C, but harfbuzz is actually a C++ library and provide C API. My cgo header

Re: [go-nuts] How to correctly use exec.Command and properly clean up all pipes

2019-12-14 Thread Ian Lance Taylor
On Sat, Dec 14, 2019 at 7:40 PM wrote: > > I need to spawn a subprocess and I'm trying to use os/exec. I need to capture > stdout/err so I'm using Cmd.StdoutPipe and Cmd.StderrPipe . The problem I'm > having is how to correctly clean up the pipes after I am done. If Cmd.Start > works fine, all I

[go-nuts] How to correctly use exec.Command and properly clean up all pipes

2019-12-14 Thread tomas . volf
Hello, I need to spawn a subprocess and I'm trying to use os/exec. I need to capture stdout/err so I'm using Cmd.StdoutPipe and Cmd.StderrPipe . The problem I'm having is how to correctly clean up the pipes after I am done. If Cmd.Start works fine, all I need to do is read everything and then

Re: [go-nuts] Locking goroutine to "main" thread

2019-12-14 Thread Ian Lance Taylor
On Sat, Dec 14, 2019 at 11:51 AM wrote: > > If I understand correctly, that would prevent me from starting any other > goroutines. The following program deadlocks: That turns out not to be the case. You can start other goroutines. Your program deadlocks because you called time.After when you

Re: [go-nuts] Locking goroutine to "main" thread

2019-12-14 Thread buchanae
I found some existing discussion on this topic: https://github.com/golang/go/issues/14163 Not sure I fully understand the reasoning there. If there is a better way forward that doesn't involve adding a controversial function to the scheduling package, I'm all ears. On Saturday, December 14,

Re: [go-nuts] Locking goroutine to "main" thread

2019-12-14 Thread buchanae
Would it be reasonable to make a Go proposal that adds something like runtime.MainThread(), which would cause the calling goroutine to only ever be scheduled on the main thread? Unlike runtime.LockOSThread, it would not need to prevent other goroutines from running on the main thread (I think).

Re: [go-nuts] Locking goroutine to "main" thread

2019-12-14 Thread buchanae
If I understand correctly, that would prevent me from starting any other goroutines. The following program deadlocks: package main import ( "log" "runtime" "time" ) func init() { runtime.LockOSThread() } func main() { go func() { for range time.After(time.Second) {

Re: [go-nuts] types lookup for error interface type

2019-12-14 Thread Dan Kortschak
I think you are right. Thanks. On Sat, 2019-12-14 at 19:20 +, Paul Jolly wrote: > > This seem massively over complicated, so I'm wondering if there is > > an > > easier way. > > I think you're after types.Universe.Lookup("error")? > > > Paul > -- You received this message because you

Re: [go-nuts] Locking goroutine to "main" thread

2019-12-14 Thread Ian Lance Taylor
On Sat, Dec 14, 2019 at 11:31 AM wrote: > > I'd really love to get that LockOSThread call out of the main function and > hide it away inside a library along with the other internal implementation > details. Is that possible? As far as I can tell, it's not possible to ensure > that a goroutine

[go-nuts] Locking goroutine to "main" thread

2019-12-14 Thread buchanae
I've been experimenting with graphics programming using go+sdl2 for awhile now. I've always been uncertain how to deal with locking a goroutine to the main thread. MacOS requires interactions with the OS window to come from the main thread. So far, I have something like this (pseudocode):

Re: [go-nuts] types lookup for error interface type

2019-12-14 Thread Paul Jolly
> This seem massively over complicated, so I'm wondering if there is an > easier way. I think you're after types.Universe.Lookup("error")? Paul -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] types lookup for error interface type

2019-12-14 Thread Dan Kortschak
I think I must have asked this really badly. I don't want a reflect.Type of an error, I want a types.Type representation of error for performing static analysis. The playground that I imagine is necessary is something like this. https://play.golang.org/p/e-FU0_4J9jK This seem massively over

Re: [go-nuts] types lookup for error interface type

2019-12-14 Thread 'Axel Wagner' via golang-nuts
https://play.golang.org/p/pdjKMn__ufA On Sat, Dec 14, 2019 at 10:07 AM Dan Kortschak wrote: > In the go/types package there is an easy way to obtain a types.Type for > basic builtin types. This doesn't exist for the error type. > > Is there an easier way to get a types.Type representing error

Re: [go-nuts] types lookup for error interface type

2019-12-14 Thread 'Axel Wagner' via golang-nuts
whoops, I misread :) types.Type,, not reflect :) On Sat, Dec 14, 2019 at 6:54 PM Axel Wagner wrote: > https://play.golang.org/p/pdjKMn__ufA > > On Sat, Dec 14, 2019 at 10:07 AM Dan Kortschak wrote: > >> In the go/types package there is an easy way to obtain a types.Type for >> basic builtin

Re: [go-nuts] types lookup for error interface type

2019-12-14 Thread Marcin Romaszewicz
Error is an interface, so its type depends on the implementation satisfying that interface. You can't just create an "error", since they don't exist, all that exists are implementation satisfying the error interface. That's what you're doing with NewSignature. Could you just create an

Re: [go-nuts] [ANN] gopkg.in/goracle.v2 renamed to github.com/godror/godror

2019-12-14 Thread Andy Balholm
They probably do, but only for database-related products, or maybe for software in general. Trademarks are industry-specific. Andy > On Dec 13, 2019, at 9:22 PM, kddavidson...@gmail.com wrote: > > I would be surprised if they have a legal claim to "Ora" as well, otherwise > the dental

[go-nuts] Re: TLS Cipher suites TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8

2019-12-14 Thread kddavidson722
Taken from https://www.iana.org/assignments/tls-parameters/tls-parameters.xml: Note > > CCM_8 cipher suites are not marked as "Recommended". These > cipher suites have a significantly truncated authentication tag > that represents a security trade-off that may not be appropriate >

[go-nuts] types lookup for error interface type

2019-12-14 Thread Dan Kortschak
In the go/types package there is an easy way to obtain a types.Type for basic builtin types. This doesn't exist for the error type. Is there an easier way to get a types.Type representing error than by using NewInterfaceType, NewFunc and NewSignature functions (I am assuming that the nil