Re: Re: [go-nuts] “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-07 Thread Bakul Shah
On Thu, 08 Feb 2018 16:17:08 +1100 Rob Pike wrote: Rob Pike writes: > > Isn't the visitor pattern just a way to implement type switch in languages > that don't implement type switch? > > That's certainly how I saw it when using C++. Go has a type switch, and so > has no need

Re: [go-nuts] “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-07 Thread Rob Pike
Isn't the visitor pattern just a way to implement type switch in languages that don't implement type switch? That's certainly how I saw it when using C++. Go has a type switch, and so has no need for the visitor pattern, a perfect example of the principle that a design pattern is just a way to

Re: [go-nuts] “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-07 Thread Josh Humphries
FWIW, it looks like someone else has gone through this exercise: https://github.com/tmrts/go-patterns *Josh Humphries* jh...@bluegosling.com On Fri, Feb 2, 2018 at 12:03 PM, wrote: > I’m looking at patterns summarized on Wikipedia from “Design Patterns: > Elements

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread Damon Zhao
Got it, thx~ 在 2018年2月7日星期三 UTC+8下午11:25:24,matthe...@gmail.com写道: > > The select already received in that case and is waiting to send, but the > select has to be re-entered for the next receive to happen. > > Matt > > On Wednesday, February 7, 2018 at 9:22:31 AM UTC-6, Damon Zhao wrote: >> >> I

[go-nuts] Wrapping executable that takes input and output files such that it uses stdin and stdout instead (using named pipes)

2018-02-07 Thread Or Rikon
Hi! I asked this previously on Stack Overflow but so far have not received a response, so I figured I will try here as well. I'm trying to wrap an executable that takes an input and output file paths as arguments, such that it will be possible to provide the input and output as stdin and

[go-nuts] Why is there no standard `uuid` package?

2018-02-07 Thread 高橋誠二
Recently satori/go.uuid took a breaking change of API, and some of frameworks which depend on the package. And google/uuid is unstable. Why Go doesn't have an official uuid package? Is there any load map to develop google/uuid and merge it to Go itself? -- You received this message because you

[go-nuts] How to install Go SDK 1.9.61 or newer?

2018-02-07 Thread Bryan
I'm trying to install Go SDK 1.9.61 or newer on osX 10.11.6 I'm am trying to figure out how to use the Delve debugger and the Atom go-debug plugin to work with GAE. The --go_debugger flag was added in Go SDK 1.9.61 $ sudo gcloud version Password: Google Cloud SDK 188.0.0 app-engine-go

Re: [go-nuts] Differentiating between reader and writer errors

2018-02-07 Thread Justin Azoff
> > > r, _ = Filter(r, query) > w = LastErrorWrapper(w) > _, err = io.Copy(w, r) > if err != nil and w.LastError != nil { # error writing to output, > abort. > I got halfway through implementing a "LastErrorWrapper" and realized it looked familiar.. that's because it's

[go-nuts] Blocking reflect.Value{}.Call()

2018-02-07 Thread snadrus
I realize that private functions of another package are not reachable by reflection, but I'm looking for a way to ensure a public interface-or-struct's function can be fully back-traced statically. An interface function like Query(sql string, args ...interface{}) Result is an SQL

Re: [go-nuts] Re: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-07 Thread roger peppe
As someone totally unfamiliar with the GoF patterns, hre's my take. I looked at the wikipedia articles and tried to work out what problem I thought the pattern was trying to address and then wrote some Go code to do that. I'm generally in agreement with those who say that these patterns are there

[go-nuts] Re: [security] Go 1.8.7, Go 1.9.4, and Go 1.10rc2 are released

2018-02-07 Thread Nathan Kerr
I updated my release related resources with these releases: - When Should You Upgrade Go? - Go Release Timeline Nathan On Wednesday, February 7, 2018 at 1:15:13 PM UTC-7, Andrew

[go-nuts] [security] Go 1.8.7, Go 1.9.4, and Go 1.10rc2 are released

2018-02-07 Thread Andrew Bonventre
Hi gophers, We have just released Go 1.8.7, Go 1.9.4, and Go 1.10rc2, to address a recently-reported security issue. We recommend that all users update to one of these releases (if you’re not sure which, choose Go 1.9.4). By using the clang or gcc plugin mechanism, it was possible for an

[go-nuts] ANN: gijit, a Go interpreter

2018-02-07 Thread Jason E. Aten
https://github.com/gijit/gi My interactive Go REPL, gijit, is quite useful now. It has structs, pointers, defer, and interfaces implemented. You can call into native Go packages. Enjoy, Jason -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[go-nuts] Asymmetrical I/O load on single TCP connection

2018-02-07 Thread Everton Marques
Hi, I wrote a simple utility https://github.com/udhos/goben to test TCP throughput between two hosts. At each endpoint, the tool spawns two goroutines: one for reading from net.TCPConn as fast as possible, other for writing into it as fast as possible. However I'm consistently obtaining uneven

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread buaa . cch
sorry for misunderstanfing.. this is not a bug... -- 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,

Re: [go-nuts] Cloud Functions Golang Support

2018-02-07 Thread matthewjuran
https://groups.google.com/forum/#!forum/gce-discussion may be a better place to ask this question. Here are the other GCP groups: https://cloud.google.com/support/docs/groups Matt On Wednesday, February 7, 2018 at 11:13:26 AM UTC-6, Sankar wrote: > > Hey Googlers, > > Any help on this ? I

Re: [go-nuts] Cloud Functions Golang Support

2018-02-07 Thread Sankar P
Hey Googlers, Any help on this ? I would love to choose GCE, but will have to go with AWS if there are no updates here. Thanks. 31 ஜன., 2018 முற்பகல் 12:08 அன்று, "Sankar" எழுதியது: > Hi > > When is Golang support for Cloud functions in GCP expected ? I am starting

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread buaa . cch
I think this is a bug, I change the logic of main goroutine and the other goroutine, then the deadlock disappeared ```go package main import ( "fmt" "time" ) var ( source = make(chan int) idle = make(chan int, 1) ) func main() { go func() { for { select { case worker := <-source: idle <-

Re: [go-nuts] Unexpect deadlock on select multi channel

2018-02-07 Thread Ian Lance Taylor
On Wed, Feb 7, 2018 at 6:24 AM, Damon Zhao wrote: > Anybody help with this issue (still not solved but I cannot reopen it) > > https://github.com/golang/go/issues/23728 The select statement works pseudo-randomly. You are sending two values on source. When the select

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread matthewjuran
The select already received in that case and is waiting to send, but the select has to be re-entered for the next receive to happen. Matt On Wednesday, February 7, 2018 at 9:22:31 AM UTC-6, Damon Zhao wrote: > > I know wrap with a goroutine can fix it. I just wonder why must use an > extra

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread Damon Zhao
I know wrap with a goroutine can fix it. I just wonder why must use an extra goroutine? 在 2018年2月7日星期三 UTC+8下午11:00:25,matthe...@gmail.com写道: > > Desynchronizing "case idle <- <-source:" fixes it: > > case v := <-source: > go func () { idle <- v }() > > I added a counter to break after a

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread matthewjuran
Desynchronizing "case idle <- <-source:" fixes it: case v := <-source: go func () { idle <- v }() I added a counter to break after a number of loops since it goes infinitely: https://play.golang.org/p/aZbmTKvpxcD Matt On Wednesday, February 7, 2018 at 8:38:41 AM UTC-6, Damon Zhao wrote: >

[go-nuts] Unexpect deadlock on select multi channel ?

2018-02-07 Thread Damon Zhao
Please answer these questions before submitting your issue. Thanks! What version of Go are you using (go version)? go version go1.9.3 darwin/amd64 Does this issue reproduce with the latest release? yes What operating system and processor architecture are you using (go env)? GOARCH="amd64"

[go-nuts] Unexpect deadlock on select multi channel

2018-02-07 Thread Damon Zhao
Anybody help with this issue (still not solved but I cannot reopen it) https://github.com/golang/go/issues/23728 -- 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

Re: [go-nuts] Differentiating between reader and writer errors

2018-02-07 Thread Justin Azoff
On Wednesday, February 7, 2018 at 8:54:12 AM UTC-5, Jakob Borg wrote: > > On 7 Feb 2018, at 14:45, Justin Azoff > wrote: > > > Is there some way to inspect that error to figure out that it was related > to reading from 'gr' and not writing to /dev/null? > > > Two options

Re: [go-nuts] Differentiating between reader and writer errors

2018-02-07 Thread Jakob Borg
On 7 Feb 2018, at 14:45, Justin Azoff > wrote: Is there some way to inspect that error to figure out that it was related to reading from 'gr' and not writing to /dev/null? Two options that come to mind are - handling the copy yourself so

[go-nuts] Re: Differentiating between reader and writer errors

2018-02-07 Thread Justin Azoff
On Wednesday, February 7, 2018 at 1:26:46 AM UTC-5, Tamás Gulácsi wrote: > > backend.FilterIPs should return differentiable error - whether this is a > transient or a permanent error. > I'd use github.com/pkg/errors: > > var ErrTransient = errors.New("transient error") > > Nice, thanks.. this is

[go-nuts] Golang Microservices Software Engineering & Team Leadership Opportunities £Significant Package OR Day Rate Contract - London W5 or EC2 based

2018-02-07 Thread stuartroe1976
Hello everyone, I am currently representing a world leading & multi-channel fashion retailer who are seeking talented Software Engineers, at Mid, Senior & Lead levels, to help them adopt the cloud and implement Infrastructure as code using Golang and Microservices. These roles can be based at

[go-nuts] Re: About golang.org/x/net/prox and cancellation

2018-02-07 Thread Juliusz Chroboczek
> unlike net.Dialer, there is no DialContext method for proxy.Dialer. That turns out to be issue #19354. -- 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

Re: [go-nuts] Debug high GC pause frequency issue

2018-02-07 Thread Vladimir Varankin
> The CPU profiler told me that the program is spending a lot of time doing GC (obviously), and memory profiler is telling me there is a huge amount of memory allocated for json encoding/decoding, which is inevitable for business logic. Even though Go is GC based language, Go prefers object

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-07 Thread Peter Waller
On 6 February 2018 at 21:25, wrote: > What do you mean by a "slice pointer key" ? > > > map[*[]Something]string > > Then map consumers can do key comparisons. I originally used this for an > unordered set type. > I'm sure you are aware of the distinction but it might