[go-nuts] Re: Updating a struct from goroutines

2018-09-26 Thread Agniva De Sarker
I think you are overcomplicating this a bit. It seems like a simple pattern of broadcasting a change to multiple agents. You send the change over a REQ-REP pair, and broadcast it to others over a PUB-SUB pair. Why do you need to copy the struct again ? Just get the struct from the REP socket

[go-nuts] Dependency resolution weirdness with Go Modules.

2018-09-26 Thread Josh Harshman
Using Go 1.11 and Go Modules to resolve package dependencies for my project. Unfortunately I am running into some vendoring issues and incompatibilities that have me a little stumped. Here is my go.mod file, there are a few packages listed as incompatible etc... go.mod module

[go-nuts] Re: [ANN] goey - Declarative, cross-platform GUIs

2018-09-26 Thread Robert Johnstone
Hello, In case anyone is still following, the readme includes some screenshots. https://bitbucket.org/rj/goey/src/default/README.md - Robert On Thursday, 6 September 2018 00:07:41 UTC-4, Robert Johnstone wrote: > > This is an initial announcement of goey, a package for declarative, >

[go-nuts] Re: "go test" recompiling already-installed packages

2018-09-26 Thread armando . m . ramirez
I still have not gotten Go to reliably use the installed go-sqlite.a in all cases. However, I have found a workaround that is speeding up my builds. I found that GOCACHE was off, and after setting it, go-sqlite3 is compiled only once per nix-shell session. Re-entering nix-shell seems to cause

Re: [go-nuts] ticker for poisson processes?

2018-09-26 Thread Sebastien Binet
On Wed, Sep 26, 2018 at 2:29 PM David Wahlstedt < david.wahlstedt@gmail.com> wrote: > Thanks--nice! > Will this be less reliable than the built-in Ticker (that uses > runtimeTimer), besides the intentional randomness? > modulo the possible bug(s) I may have unintentionally introduced, I

Re: [go-nuts] defining custom struct, confused

2018-09-26 Thread 'Mudasir Mirza' via golang-nuts
Hey, Thanks allot, that fixed the issue and I really appreciate it. On Wed, Sep 26, 2018 at 6:43 PM wrote: > Two things: > > 1) Capitalize users inside allUsers so it can be populated via reflection > 2) Use an intermediary type to allow for that slice inside slice > >

Re: [go-nuts] defining custom struct, confused

2018-09-26 Thread silviucapota
Two things: 1) Capitalize users inside allUsers so it can be populated via reflection 2) Use an intermediary type to allow for that slice inside slice https://play.golang.org/p/RvW7PMSOZlq On Wednesday, 26 September 2018 10:10:41 UTC-4, Mudasir Mirza wrote: > > Also as per the API documentation

Re: [go-nuts] defining custom struct, confused

2018-09-26 Thread 'Mudasir Mirza' via golang-nuts
Also as per the API documentation of the vendor, I am suppose to get a response in format ListUserResponse { users (Array[V1User], optional), _selfUrl (string, optional) } On Wed, Sep 26, 2018 at 6:03 PM Mudasir Mirza wrote: > Hi Steven, > > Thanks for your prompt response. I know that, but I

Re: [go-nuts] defining custom struct, confused

2018-09-26 Thread 'Mudasir Mirza' via golang-nuts
Hi Steven, Thanks for your prompt response. I know that, but I can not figure out how to define that in my struct :( On Wed, Sep 26, 2018 at 5:55 PM Steven Hartland wrote: > If you look closely they have a strange structure: > "users": [*[*{...},{...}*]*] > > You've created: >

Re: [go-nuts] defining custom struct, confused

2018-09-26 Thread Steven Hartland
If you look closely they have a strange structure:  "users": [*[*{...},{...}*]*] You've created: "users":[{...},{...}] On 26/09/2018 14:43, 'Mudasir Mirza' via golang-nuts wrote: Hey guys, I am fairly new to GoLang, still learning. I am trying to working on a small utility, which fetches

[go-nuts] defining custom struct, confused

2018-09-26 Thread 'Mudasir Mirza' via golang-nuts
Hey guys, I am fairly new to GoLang, still learning. I am trying to working on a small utility, which fetches details from a third party. As per their documentation, I will get response something like { "users": [ [ { "firstName": "string ", "lastName": "string",

Re: [go-nuts] run cmd and capture output on remote machine

2018-09-26 Thread Hemant Singh
I was using ssh with the exec package. However, I didn't know how to capture the output of the cmd run. Today, I studied the exec package and found the Output functionality. Now I can capture the output. https://golang.org/pkg/os/exec/?m=all#Cmd.Output Best, Hemant On Tuesday, September

Re: [go-nuts] ticker for poisson processes?

2018-09-26 Thread David Wahlstedt
Thanks--nice! Will this be less reliable than the built-in Ticker (that uses runtimeTimer), besides the intentional randomness? /David Den tisdag 25 september 2018 kl. 18:43:33 UTC+2 skrev Sebastien Binet: > > > > On Tue, Sep 25, 2018 at 11:34 AM David Wahlstedt > wrote: > >> Hi, >> What would

[go-nuts] Re: ticker for poisson processes?

2018-09-26 Thread David Wahlstedt
Interesting, thanks! But: do you mean this is a Poisson process? /David Den tisdag 25 september 2018 kl. 12:45:46 UTC+2 skrev Louki Sumirniy: > > If you don't mind it involving a small background processing overhead, you > could use a goroutine running a hashcash style iterative hash chain >

[go-nuts] Re: idiomatic code to find, if executable exists in golang

2018-09-26 Thread Dave Cheney
My suggestion is, rather than seeing if an executable exists, then executing it. Just execute it and if there is an error just pass it back to the caller. The difference between I tried to run the program but it wasn’t found and I tried to run the program but it failed for some reason shouldn’t

[go-nuts] Re: idiomatic code to find, if executable exists in golang

2018-09-26 Thread Nilsocket
On Wednesday, September 26, 2018 at 1:16:51 PM UTC+5:30, Dave Cheney wrote: > > Are you able to modify the original question. Why do you need to know if a > binary exists? Presumably so you can execute it. If so then you can modify > the original request and make the problem more tractable.

[go-nuts] idiomatic code to find, if executable exists in golang

2018-09-26 Thread Dave Cheney
Are you able to modify the original question. Why do you need to know if a binary exists? Presumably so you can execute it. If so then you can modify the original request and make the problem more tractable. -- You received this message because you are subscribed to the Google Groups

[go-nuts] idiomatic code to find, if executable exists in golang

2018-09-26 Thread Nilsocket
package main import ( "os" "os/exec" ) func main() { cmdName := os.Args[1] //either cmd or executable without arguments if _, err := exec.LookPath(cmdName); err != nil { if (err.(*exec.Error)).Err == exec.ErrNotFound { // executable doesn't exist, do