Re: [go-nuts] cgo & long jump

2019-12-09 Thread Ian Lance Taylor
On Mon, Dec 9, 2019 at 10:30 AM wrote: > > So should I interpret your answer as long jumps are not supported and > caller of C function from Go must ensure that called C function would > not call longjmp()? Correct: Go code should not call C code that calls longjmp. (Well, it's OK to call C

Re: [go-nuts] Help with Go channels and select talk

2019-12-09 Thread 'Bryan C. Mills' via golang-nuts
I agree. It seems to me that the problem in example 2 is deep in the architecture of the program, not just a detail of the `select` statements. The `connect` function essentially functions as a single-worker “worker pool”, storing the data in a goroutine (specifically, in the closure of the

Re: [go-nuts] Re: help with reflect

2019-12-09 Thread Dan Kortschak
On Mon, 2019-12-09 at 14:57 +0300, Vasiliy Tolstov wrote: > Nevermind. I found the error https://paulcunningham.me/nevermind-found-answer/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] cgo & long jump

2019-12-09 Thread Dan Kortschak
This breaks my already fairly tenuous grasp of the progression of time; what do you mean by since "since then" when that event is a personal that is in the past (do you mean between going to sleep in the future and waking up in the past). Time [travel] is hard. On Mon, 2019-12-09 at 11:24 -0800,

[go-nuts] Re: [golang-dev] Go 1.13.5 and Go 1.12.14 are released

2019-12-09 Thread Brian Hatfield
Hi there, This appears to still not be available in Homebrew: https://github.com/Homebrew/homebrew-core/blob/master/Formula/go.rb Is there a plan for releasing 1.13.5 to Homebrew? Thanks! On Wed, Dec 4, 2019 at 9:01 PM Alexander Rakoczy wrote: > Hello gophers, > > We have just released Go

Re: [go-nuts] cgo & long jump

2019-12-09 Thread Robert Engels
That usage of setjmp and longjmp are pretty much banned in modern C by every linter. You can only call setjmp/longjmp within the current call stack (at least that's my understanding) - intermixing the context switch to Go would not be correct. Just have a wrapper on f2() that takes the

Re: [go-nuts] cgo & long jump

2019-12-09 Thread Michael Jones
The longjmp() facility is a wild, dangerous, improper, and popular mechanism. It's premise is that the app can go back in time, like you waking up last week with no knowledge of what happened since then. If you can follow that analogy, then imagine your surprise when external things you did last

Re: [go-nuts] Re: Why Iran is banned by Google?

2019-12-09 Thread Michael Jones
Hello parisaparvizi1994, Your frustration feels natural and understandable to me. Jan just answered you clearly, but since my words did not help, I'm thinking to try again. Maybe I can do better this time. First though, I must be clear that *I no longer speak for Google*--well, at least not

Re: [go-nuts] cgo & long jump

2019-12-09 Thread pali
On Monday 09 December 2019 10:18:26 Ian Lance Taylor wrote: > On Mon, Dec 9, 2019 at 8:57 AM wrote: > > > > I would like to ask some technical question about cgo and long jumps. > > > > In Go I have written shared library which exports C API and therefore > > can be called by other C

Re: [go-nuts] cgo & long jump

2019-12-09 Thread Ian Lance Taylor
On Mon, Dec 9, 2019 at 8:57 AM wrote: > > I would like to ask some technical question about cgo and long jumps. > > In Go I have written shared library which exports C API and therefore > can be called by other C applications. This my library is compiling with > cgo, more precisely via: go build

Re: [go-nuts] Задача: Дано число int 324. Как получить 9?

2019-12-09 Thread Hayato Kawakami
Вы имеете в виду, как рассчитать сумму каждой цифры? Пример кода выглядит следующим образом. https://play.golang.org/p/Wht4jgELnTI Do you mean how to calculate sum of the each digit? The sample code is as follows. https://play.golang.org/p/Wht4jgELnTI 2019年12月9日(月) 17:40 Vital Nabokov :

Re: [go-nuts] Re: Why Iran is banned by Google?

2019-12-09 Thread Jan Mercl
On Mon, Dec 9, 2019 at 5:57 PM wrote: > So in simpler words, Google has banned Iran, right? Wrong. Michael was, 5 years ago, very precise and clear about the facts, which are exactly the opposite. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] rpc.debugLog unexported

2019-12-09 Thread Atakan Çolak
Hi, I had tried a similar approach for customizing golokia . Why do we need to move the imported packages code to the project directory? Doesn't go compile using the local copy of the imported package in GOPATH? What am I missing here? 8 Aralık 2019

[go-nuts] cgo & long jump

2019-12-09 Thread pali
Hello! I would like to ask some technical question about cgo and long jumps. In Go I have written shared library which exports C API and therefore can be called by other C applications. This my library is compiling with cgo, more precisely via: go build -buildmode=c-shared -compiler gc Now I

Re: [go-nuts] Re: Why Iran is banned by Google?

2019-12-09 Thread parisaparvizi1994
So in simpler words, Google has banned Iran, right? because I live in Iran and being unable to access some website by our government is cruel enough but being banned by others specially google is just unbearable. we grew up with google and we always admire its company and we don't deserve to be

[go-nuts] Help with Go channels and select talk

2019-12-09 Thread luka . venac
You can do it without a goroutine as long as the channel has at least one buffer slot so execution passes to the select and uses the data. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Re: help with reflect

2019-12-09 Thread Vasiliy Tolstov
Nevermind. I found the error пн, 9 дек. 2019 г. в 12:30, Vasiliy Tolstov : > > Hi! I'm stuck at reflection based struct assignment. > > example struct > type TestStruct struct { > Slice []*string > } > > func TestReflect(t *testing.T) { > s1 := "one" > s2 := "two" > s1 := "one" > s2 :=

Re: [go-nuts] querying whether the go command would run in module mode

2019-12-09 Thread Paul Jolly
I raised https://github.com/golang/go/issues/36052 for discussion. On Mon, 9 Dec 2019 at 10:29, Dan Kortschak wrote: > > Thanks. > > Yes, I always have GO111MODULE=on, hence the difference. > > On Mon, 2019-12-09 at 10:04 +, Paul Jolly wrote: > > > When you're not in a module it returns

Re: [go-nuts] querying whether the go command would run in module mode

2019-12-09 Thread Dan Kortschak
Thanks. Yes, I always have GO111MODULE=on, hence the difference. On Mon, 2019-12-09 at 10:04 +, Paul Jolly wrote: > > When you're not in a module it returns /dev/null on linux. I don't > > suppose this is platform independent? > > I have to say what you saw surprised me until Daniel Martí

[go-nuts] Re: help with reflect

2019-12-09 Thread Vasiliy Tolstov
Mainly i have bigger requirement: type TestStruct struct { Slice []*TestItem } type TestItem struct { Value1 string Value2 string } so i need to create slice via reflect in TestStruct variable, create variable for TestItem and iterate over TestItem fields and assign to it Value1 and Value2

Re: [go-nuts] querying whether the go command would run in module mode

2019-12-09 Thread Paul Jolly
> When you're not in a module it returns /dev/null on linux. I don't > suppose this is platform independent? I have to say what you saw surprised me until Daniel Martí and I did a bit of experimentation. It seems the value of GO111MODULE matters here. If you have GO111MODULE=on then the result

Re: [go-nuts] querying whether the go command would run in module mode

2019-12-09 Thread Jamil Djadala
On Mon, 09 Dec 2019 19:57:48 +1030 Dan Kortschak wrote: > Thanks. > > When you're not in a module it returns /dev/null on linux. I don't > suppose this is platform independent? Hi, This command: go env GOMOD returns 1 emty line, i dont see any /dev/null ? -- Jamil Djadala -- You received

[go-nuts] help with reflect

2019-12-09 Thread Vasiliy Tolstov
Hi! I'm stuck at reflection based struct assignment. example struct type TestStruct struct { Slice []*string } func TestReflect(t *testing.T) { s1 := "one" s2 := "two" s1 := "one" s2 := "two" nodes := []*string{, } v := {} valueOf := reflectValue(v) typeOf := reflectType(v) for i := 0; i

Re: [go-nuts] querying whether the go command would run in module mode

2019-12-09 Thread Dan Kortschak
Thanks. When you're not in a module it returns /dev/null on linux. I don't suppose this is platform independent? On Mon, 2019-12-09 at 06:52 +, Paul Jolly wrote: > go env GOMOD - gives the path to the go.mod in use in module mode, > and is > empty otherwise (i.e. GOPATH mode) > > On Mon, 9