Re: [go-nuts] Multiple HTTP Clients best practice

2017-09-06 Thread Hawari Rahman
Hi Shawn, Based on what we've experienced after using separate http.Client per microservices (see my previous reply), my best guess that it was because of connection reuse. Since we now have each connection pool dedicated to single host only, it helps performance quite significantly. Thank

[go-nuts] Tools for 80 column split for golang

2017-09-06 Thread Sankar
Hi Are there any tools available for golang to split long functions so that they can fit in 80 columns (as long as possible) ? For example: ``` mux.Handle("/login", handlers.LoggingHandler(os.Stderr, http.HandlerFunc(lh.LoginHandler))) mux.Handle("/add-referrer",

Re: [go-nuts] Multiple HTTP Clients best practice

2017-09-06 Thread Shawn Milochik
Very good question. I don't know, and obviously it would be preferable to understand what's really going on. From a distance the best I can do is guess. If you did try it with multiple clients and it fixes the problem then that should point you in the right direction. If not, try Go's profiler,

[go-nuts] Re: Multiple HTTP Clients best practice

2017-09-06 Thread Hawari Rahman
Hi Jakub, Yes, that's what we're finally doing now, we're using separate http.Client for each microservice. And I can say that the performance improvement is quite significant. Based on your comment, can you maybe give me an insight on the relationship between http.Client and http.Transport?

Re: [go-nuts] Multiple HTTP Clients best practice

2017-09-06 Thread Hawari Rahman
Hi Shawn, That's a nice suggestion, but one question comes to mind though: I'm curious on where our previous implementation failed at. From what I learned at golang website , it states that an http.Client is concurrent safe and should be reused

[go-nuts] Re: javascript libraries

2017-09-06 Thread Rajanikanth Jammalamadaka
I did not use this much, but try gopherjs: https://github.com/gopherjs/gopherjs On Wednesday, September 6, 2017 at 10:32:49 PM UTC-4, Vickey Rawat wrote: > > Is there any javascript package in go by which i can create javascript > graphs and tables without having to learn a new language. > > I

[go-nuts] javascript libraries

2017-09-06 Thread vickey . coool
Is there any javascript package in go by which i can create javascript graphs and tables without having to learn a new language. I mean something like we do in r programming. Is there any such package. I want to create a dashboard like web app. Can we do it in go yet -- You received this

[go-nuts] Intel SGX from Go anyone?

2017-09-06 Thread Hein Meling
Hello everybody, I'm interested in testing out Intel SGX for a few projects, and since Go is my language of choice, I tried to google to see if anyone has done language bindings using cgo for interaction with SGX on Linux or something along those lines. I found nothing for Go, but found

Re: [go-nuts] How to dynamically update golang plugin(so file)?

2017-09-06 Thread Ian Lance Taylor
On Tue, Sep 5, 2017 at 10:03 PM, Jason Wang wrote: > > I have the following two files: > > // hello.go > package main > > import ( > "fmt" > ) > > func Hello() { > fmt.Println("hello") > } > > func main() {} > > > build as plugin: `go build -buildmode=plugin hello.go` > > //

Re: [go-nuts] Multiple HTTP Clients best practice

2017-09-06 Thread Shawn Milochik
One possibility I saw in a talk on YouTube a couple of years ago (sorry, couldn't find the link). 1. Have a buffered channel of clients. 2. Try to grab a client from the channel for each request, using a time.Timer to time out after a reasonable amount of time (one second, 100 ms,

[go-nuts] Multiple HTTP Clients best practice

2017-09-06 Thread Hawari Rahman
Hello everyone, We're building an API Gateway in our company. Basically what this gateway does is that it processes request from external clients and when doing so, it communicates with our microservices. Some request can have as much as 5 microservices to communicate with in order to be

[go-nuts] Re: newbie with go 1.9 troubles

2017-09-06 Thread Prateek Pandey
Follow these steps: 1. sudo rm -rf /usr/local/go (check the path by "which go") 2. download the tar file and un-tar it. wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz On Friday, September 1, 2017 at 8:56:31 PM

[go-nuts] How to dynamically update golang plugin(so file)?

2017-09-06 Thread Jason Wang
I have the following two files: // hello.go package main import ( "fmt" ) func Hello() { fmt.Println("hello") } func main() {} build as plugin: `go build -buildmode=plugin hello.go` // main.go package main import ( "log" "plugin" "time" ) func main() { for { log.Println("start load

[go-nuts] syscall.Munmap returns "invalid argument" error when unmapping a file for a second time

2017-09-06 Thread brightsparc
Hi, I am looking to use mmap to load data blocks within a large memory mapped file, but am getting "invalid argument" anytime i unmap a file for the second time. See attached an example file which replicates this issue. Note the firset read operation successed, and the file descriptor being

[go-nuts] One way - Unexported json field

2017-09-06 Thread ascarter
You might be able to use this technique: https://attilaolah.eu/2014/09/10/json-and-struct-composition-in-go/ -- 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

[go-nuts] Re: Go-kit middlewares

2017-09-06 Thread Flying
you can refer to golang chi opensource for middleware 在 2017年9月5日星期二 UTC+8下午11:13:40,Ilya Novikov写道: > > Hello!I would like to understand how middleware works in go-kit. I want to > write a middleware auth processor but do not understand how to describe the > logic of the process. > > That is,

Re: [go-nuts] Re: 『Q』How to make hugepagesize work with Go?

2017-09-06 Thread Pradeep Singh
On Wed, Sep 6, 2017 at 2:58 AM, Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > It is correct that you get superpages/hugepages automatically if they are > enabled. But your software must also allocate pages in a way which lets the > operating system carve out a huge page

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Steven Hartland
You other option is: splittable == v != ' ' && v == unicode.ToLower(v), depends what you want to happen with non-word characters? On 06/09/2017 16:15, Michael Jones wrote: Precisely, though probably a renaming is in order: https://play.golang.org/p/AZ7Ptg4HYP On Wed, Sep 6, 2017 at 6:58 AM,

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Michael Jones
Precisely, though probably a renaming is in order: https://play.golang.org/p/AZ7Ptg4HYP On Wed, Sep 6, 2017 at 6:58 AM, Steven Hartland wrote: > Numbers don't match IsLower so how about: > https://play.golang.org/p/Z6q9dJZ7QK > > > On 06/09/2017 14:12, Tong Sun wrote: >

[go-nuts] [ANN]: A Text Editor based on Acme in Go

2017-09-06 Thread as
Ever since my Acme SAC stopped working on Windows I thought it was about time Go had a native version of a great text editor like Acme or Sam. I've seen some interesting posts about it, but figured it would be a better experience to see how much work goes in to making a graphical text editor

Re: [go-nuts] "find" for Slices like "append"

2017-09-06 Thread DV
Go has never been a "let's include all possible methods for all possible use-cases for all possible users" type of language. It's just not in its DNA. You seem to like Python - so why not stick with Python? Do lots of C++ people complain about how Javascript doesn't let you do pointer

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Steven Hartland
Numbers don't match IsLower so how about: https://play.golang.org/p/Z6q9dJZ7QK On 06/09/2017 14:12, Tong Sun wrote: Almost, https://play.golang.org/p/6Zl_EKqFqT But thanks a lot! It's significantly shorter/better than my initial version. On Tue, Sep 5, 2017 at 6:18 PM, Michael Jones

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Tong Sun
Almost, https://play.golang.org/p/6Zl_EKqFqT But thanks a lot! It's significantly shorter/better than my initial version. On Tue, Sep 5, 2017 at 6:18 PM, Michael Jones wrote: > Like this? > > https://play.golang.org/p/OIE8jdWVGB > > On Tue, Sep 5, 2017 at 12:33 PM, Tong

[go-nuts] Re: One way - Unexported json field

2017-09-06 Thread Vincent Jouglard
Hi, Thx Egon, I though about having a special action before exporting, I was expecting something more straightforward if that existed. I'll that then ! Thanks, Le mercredi 6 septembre 2017 06:20:07 UTC+2, Egon a écrit : > > Make a method that creates a copy of the Player with erasing the

Re: [go-nuts] A question about evaluation of channel’s send statement

2017-09-06 Thread T L
On Wednesday, September 6, 2017 at 7:38:04 AM UTC-4, T L wrote: > > > > On Wednesday, September 6, 2017 at 6:40:46 AM UTC-4, Jakob Borg wrote: >> >> On 6 Sep 2017, at 10:28, T L wrote: >> > It is just weird that the evaluation timing of *p is different to other >>

Re: [go-nuts] A question about evaluation of channel’s send statement

2017-09-06 Thread T L
On Wednesday, September 6, 2017 at 6:40:46 AM UTC-4, Jakob Borg wrote: > > On 6 Sep 2017, at 10:28, T L wrote: > > It is just weird that the evaluation timing of *p is different to other > expressions, such as, *p+0, *p*1, func()int{return *p}m etc. > > The value depends

Re: [go-nuts] A question about evaluation of channel’s send statement

2017-09-06 Thread T L
On Wednesday, September 6, 2017 at 6:40:46 AM UTC-4, Jakob Borg wrote: > > On 6 Sep 2017, at 10:28, T L wrote: > > It is just weird that the evaluation timing of *p is different to other > expressions, such as, *p+0, *p*1, func()int{return *p}m etc. > > The value depends

Re: [go-nuts] Extending image.Image with Set

2017-09-06 Thread Florian
I didn't know about image/draw, thank you! The linked doc has a very helpful example and references a a good blog post. Am Dienstag, 5. September 2017 04:46:24 UTC+2 schrieb James Fargher: > > I think your ImageSetter is already in the standard library > https://golang.org/pkg/image/draw/#Image

Re: [go-nuts] A question about evaluation of channel’s send statement

2017-09-06 Thread Jakob Borg
On 6 Sep 2017, at 10:28, T L wrote: > It is just weird that the evaluation timing of *p is different to other > expressions, such as, *p+0, *p*1, func()int{return *p}m etc. The value depends on a data race so it's entirely undefined in all cases. That the actual outcome

Re: [go-nuts] Re: 『Q』How to make hugepagesize work with Go?

2017-09-06 Thread Jesper Louis Andersen
It is correct that you get superpages/hugepages automatically if they are enabled. But your software must also allocate pages in a way which lets the operating system carve out a huge page through a mmap() call (or similar). If the hugepage is 2 megabytes and your garbage collector allocates in

Re: [go-nuts] A question about evaluation of channel’s send statement

2017-09-06 Thread T L
On Tuesday, September 5, 2017 at 11:04:52 PM UTC-4, Jesse McNelis wrote: > > On Wed, Sep 6, 2017 at 2:26 AM, T L > wrote: > > > > I mean it can be viewed as a bug for inconsistency. > > But from the memory model view, it can also not be viewed as a bug. > > > > It's

[go-nuts] Golang dep missing vendor dependencies

2017-09-06 Thread st ov
I'm not seeing dep ensure the transitive dependencies of my vendored packages. How do I ensure that all dependencies are downloaded? -- 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