[go-nuts] Re: Go application hanging and throwing Proxy error: Request Canceled or I/O timeout

2016-06-27 Thread Dave Cheney
Your application has probably run out of file descriptors. On linux you can get a sense of the number of active file descriptors your program is using by looking in the /proc/$PID/fd directory. Where $PID is the process id of your program. /proc/$PID/limits will tell you the current limits for

[go-nuts] Re: Trying to dynamically find interfaces

2016-06-27 Thread Egon
On Monday, 27 June 2016 17:16:40 UTC+3, David Koblas wrote: > > I've got a program that is trying to implement functions on "subclasses", > where the parent can check to see if the interface is implemented. For > perspective, it's really dealing with REST URL generation based on if > methods exi

Re: [go-nuts] Go application hanging and throwing Proxy error: Request Canceled or I/O timeout

2016-06-27 Thread Shawn Milochik
I don't have any insight as to why it's suddenly happening when you change Go versions, but I've run into the same problem previously, and re-using HTTP clients and setting MaxIdleConnsPerHost completely solved it for me. https://paperairoplane.net/?p=556 -- You received this message because yo

[go-nuts] Go application hanging and throwing Proxy error: Request Canceled or I/O timeout

2016-06-27 Thread dkbalachandar
I am currently facing an issue in my load environment during the load testing. The description of the issue is given below, We have a Jersey REST application which is being guarded by a GO application. GO app validates the browser cookie and creates a single host reverse proxy and serve the

[go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread Tamás Gulácsi
Don't Stat on every log line, but use some other mechanism (mutex, channel) to rotate the logs every day. -- 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-

[go-nuts] Example to write web application needs correction

2016-06-27 Thread Madhu Sudhan C S
Hi All, Example to write web application https://golang.org/doc/articles/wiki/final.go needs to be corrected to fix an error leading to 'http: multiple response.WriteHeader calls'. In the renderTemplate() func if there is an error while exectuing the line templates.ExecuteTemplate(w, tmpl+".ht

Re: [go-nuts] Re: Trouble querying REST API with net/http (api verified working with curl)

2016-06-27 Thread Kiki Sugiaman
Haha! Happens to the best of us every once in a while. On 28/06/16 02:57, mark mellar wrote: ksug, you were right... I was able to replicate the error using curl by changing the -x parameter from 'GET' to 'Get' . How embarrassing, I'll go sit in the corner and think about what I've done...

[go-nuts] Re: Best practice when putting large amounts of functionality behind an interface

2016-06-27 Thread Tyler Compton
The interface I'm speaking of can be found here[1] on Github. I like your idea of composing interfaces. Most all of my operations fall into groups based on what kind of object they can operate on, so I could have interfaces for each kind and perhaps a master interface composed of every other in

Re: [go-nuts] Re: formal verification in Go? someday perhaps?

2016-06-27 Thread Scott Cotton
I don't see why not either. I think what's missing for targeting go is this: A library taking ssa representation and producing formal representations (formulae, transition systems, models of parallelism,...) I guess that may actually be many libraries, as there are many different ways to model.

Re: [go-nuts] Question - type assertion x.(*T)

2016-06-27 Thread 'Axel Wagner' via golang-nuts
Hm? It's this syntax: https://golang.org/ref/spec#Type_assertions using *T as the type. On Mon, Jun 27, 2016 at 11:08 PM, wrote: > Hi, > > Reading through gaoling spec regarding type assertions, in some code I've > see type assertions like: > a := x.(*T) > > i don't see a mention of that syntax

Re: [go-nuts] Re: formal verification in Go? someday perhaps?

2016-06-27 Thread Daniel Skinner
> I think a better question is: can go tools for formal verification become available? I did some research on formal verification recently, no experience previously. I don't really see why not. Just digging through my own code, I have an implementation of the simplex method which I could use to s

[go-nuts] Re: Best practice when putting large amounts of functionality behind an interface

2016-06-27 Thread Chad
What does the interface look like currently? On Monday, June 27, 2016 at 10:54:31 PM UTC+2, Tyler Compton wrote: > > Right now, I have a web server with an interface that defines methods for > every kind of database read/write operation my application has. > Any example ? > Unsurprisingly, it

[go-nuts] 'go tool pprof' only shows "Type: CPU" and not a callgraph

2016-06-27 Thread Dave Cheney
What are the exact commands you used? It is easy to misuse proof, here is a slide with some of the gotchas. http://talks.godoc.org/github.com/davecheney/presentations/writing-high-performance-go.slide#11 -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Question - type assertion x.(*T)

2016-06-27 Thread michaelwain1990
Hi, Reading through gaoling spec regarding type assertions, in some code I've see type assertions like: a := x.(*T) i don't see a mention of that syntax in the spec, what is it doing? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr

Re: [go-nuts] Re: 'go tool pprof' only shows "Type: CPU" and not a callgraph

2016-06-27 Thread Ian Lance Taylor
On Mon, Jun 27, 2016 at 1:52 PM, Kyle Stanly wrote: > I'd also like to mention I did try both 'runtime/pprof' and > github.com/pkg/profile, both yield the same (lack of) results. We can't help you without more information. What kind of system, what version of Go, what sort of program, exactly wh

[go-nuts] Best practice when putting large amounts of functionality behind an interface

2016-06-27 Thread Tyler Compton
Right now, I have a web server with an interface that defines methods for every kind of database read/write operation my application has. Unsurprisingly, it's pretty large for a Go interface at around 30 methods. I originally did this because I wanted to be able to support multiple implementati

[go-nuts] Re: 'go tool pprof' only shows "Type: CPU" and not a callgraph

2016-06-27 Thread Kyle Stanly
I'd also like to mention I did try both 'runtime/pprof' and github.com/pkg/profile, both yield the same (lack of) results. On Monday, June 27, 2016 at 4:10:26 PM UTC-4, Kyle Stanly wrote: > > For some strange reason, when I run pprof tool I do not get the Callgraph > of the function calls, merel

Re: [go-nuts] Re: upx / darwin support

2016-06-27 Thread robfig
Go 1.6 I haven't tried tip but according to a comment on a related issue , it doesn't sound like this is seen as Go's issue so I wouldn't expect any changes $ GOOS=darwin go build -o glock github.com/robfig/glock $ upx glock

[go-nuts] 'go tool pprof' only shows "Type: CPU" and not a callgraph

2016-06-27 Thread Kyle Stanly
For some strange reason, when I run pprof tool I do not get the Callgraph of the function calls, merely the overall CPU usage, no more. I insert pprof.StartCPUProfile() and pprof.StopCPUProfile() at sections I want to test, and I even adjusted the sampling rate with runtime,SetCPUProfileRate(10

[go-nuts] Re: Trying to dynamically find interfaces

2016-06-27 Thread Tim O'Brien
It's best to have a function to create your BaseAppController: func NewBaseAppContoller(subClasses ...interface{}) *BaseAppController { for _, i := range subClasses { } } On Monday, 27 June 2016 15:16:40 UTC+1, David Koblas wrote: > > I've got a program that is trying to implement functions on

[go-nuts] Re: database proxy ?

2016-06-27 Thread Tamás Gulácsi
Why do you need such a thing? gopkg.in/rana/ora.v3 (esp. the current master branch) has a simple Pool implementation for reusing connections - but no connection limit. Oracle does have a SessionPool implementation, but haven't used it yet. Otherwise, database/sql/driver is quite limited, you cou

[go-nuts] Re: Shuffle Items in a Slice

2016-06-27 Thread Chris Hines
The history of this behavior is explained in the release notes for Go 1.3: https://golang.org/doc/go1.3#map On Friday, June 24, 2016 at 8:48:20 AM UTC-4, Val wrote: > > 2 implementations here : > http://www.programming-idioms.org/idiom/10/shuffle-a-list/1564/go > > As for the map iteration trick

Re: [go-nuts] Append to slice... what happens?

2016-06-27 Thread Ian Lance Taylor
On Sun, Jun 26, 2016 at 10:55 PM, Dan Kortschak wrote: > On Mon, 2016-06-27 at 07:49 +0200, Martin Geisler wrote: >> BTW, I was about to say that you could simplify the line one step >> further with >> >> b := append(a[::len(a)], 3, 4) >> >> but that gives a compilation error: >> >> prog.go:11

Re: [go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread Konstantin Khomoutov
On Mon, 27 Jun 2016 00:21:01 -0700 (PDT) feng19910...@gmail.com wrote: [...] > After running several times the system file cache becomes very large > > CONTAINERCPU % MEM USAGE / LIMIT MEM % NET > I/O BLOCK I/O zyapi_801138.47%6.442 GB / 6.442 GB > 100.00%

Re: [go-nuts] golang.org/x/sys/unix: SockAddrInet4 doesn't implement SockAddr?

2016-06-27 Thread Minoru KINOSHITA
Oh, I can successfully compiled my code both on Darwin and Linux. Thank you! -- KINOSHITA Minoru kinoshita.minor...@gmail.com 2016年6月28日(火) 1:17 Michael Jones : > The compilation error is because Connect wants a pointer. Do this instead… > > sa := &unix.SockaddrInet4{Port: 0, Addr: [4]byte{127,

Re: [go-nuts] Re: Trouble querying REST API with net/http (api verified working with curl)

2016-06-27 Thread mark mellar
ksug, you were right... I was able to replicate the error using curl by changing the -x parameter from 'GET' to 'Get' . How embarrassing, I'll go sit in the corner and think about what I've done... Thanks for your help guys! Mark. On Monday, June 27, 2016 at 7:12:59 AM UTC+1, ksug wrote: > >

Re: [go-nuts] Where is .gosymtab in go binaries with cgo?

2016-06-27 Thread Gulácsi Tamás
Ok, will do. Ian Lance Taylor ezt írta (időpont: 2016. jún. 26., V, 22:53): > On Sun, Jun 26, 2016 at 1:28 PM, Tamás Gulácsi > wrote: > > > > 2016. június 26., vasárnap 21:42:15 UTC+2 időpontban Ian Lance Taylor a > > következőt írta: > >> > >> On Sun, Jun 26, 2016 at 12:18 AM, Tamás Gulácsi >

[go-nuts] Re: database proxy ?

2016-06-27 Thread Tieson Molly
Is there anything for Oracle ? On Monday, June 27, 2016 at 12:40:12 PM UTC-4, Caleb Doxsey wrote: > > For postgres use pgbouncer. For mysql there's youtube's vitess. > > On Monday, June 27, 2016 at 12:24:32 PM UTC-4, Tieson Molly wrote: >> >> >> Are there any existing packages or libraries that i

[go-nuts] Re: database proxy ?

2016-06-27 Thread Caleb Doxsey
For postgres use pgbouncer. For mysql there's youtube's vitess. On Monday, June 27, 2016 at 12:24:32 PM UTC-4, Tieson Molly wrote: > > > Are there any existing packages or libraries that implement a generic > database/sql proxy? > > My goal was to create a small service that connected to the data

[go-nuts] database proxy ?

2016-06-27 Thread Tieson Molly
Are there any existing packages or libraries that implement a generic database/sql proxy? My goal was to create a small service that connected to the database and implemented a connection pool. Then other services would proxy their database/sql calls to this service rather than make their own

Re: [go-nuts] golang.org/x/sys/unix: SockAddrInet4 doesn't implement SockAddr?

2016-06-27 Thread Michael Jones
The compilation error is because Connect wants a pointer. Do this instead… sa := &unix.SockaddrInet4{Port: 0, Addr: [4]byte{127, 0, 0, 1}} Michael Jones michael.jo...@gmail.com > On Jun 27, 2016, at 8:42 AM, kinoshita.minor...@gmail.com wrote: > > Hi everyone, > > I am sorry for my newbie que

[go-nuts] golang.org/x/sys/unix: SockAddrInet4 doesn't implement SockAddr?

2016-06-27 Thread kinoshita . minoru22
Hi everyone, I am sorry for my newbie question. I want to study law-level socket programming in go using system calls (such as to implement ARP). For my first trial I have tested the code below named socket.go on Mac OS X 10.11.5 (darwin amd64), but I got the following error: # go run packet.

Re: [go-nuts] golang poll/epoll/select

2016-06-27 Thread Konstantin Khomoutov
On Mon, 27 Jun 2016 06:26:59 -0700 (PDT) Michael Soulier wrote: > > Hmm. Maybe I misunderstand how runsv connects the two. A simple > > shell test seems to behave more as expected. I'll need to dig. > > > I think I found it. On read I'm getting "resource temporarily > unavailable", so I suspect r

Re: [go-nuts] golang poll/epoll/select

2016-06-27 Thread Michael P. Soulier
On 2016-06-27 11:26 AM, Ian Lance Taylor wrote: > The golang.org/x/sys/unix package support Poll on GNU/Linux. For now I'm using select so it works on darwin too. Seems to work so far. Thanks, Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] golang poll/epoll/select

2016-06-27 Thread Ian Lance Taylor
On Mon, Jun 27, 2016 at 6:26 AM, Michael Soulier wrote: > On Saturday, June 25, 2016 at 9:03:59 PM UTC-4, Michael Soulier wrote: >> >> Hmm. Maybe I misunderstand how runsv connects the two. A simple shell test >> seems to behave more as expected. I'll need to dig. >> > > I think I found it. On rea

Re: [go-nuts] Is it safe enough to read uint without lock/atomic operation?

2016-06-27 Thread Ian Lance Taylor
On Mon, Jun 27, 2016 at 4:38 AM, 苏沛 wrote: > So data race may occur in len(someChan) ? Channel len is volatile. > > func reflect_chanlen(c *hchan) int { > if c == nil { > return 0 > } > return int(c.qcount) > } The language spec specifically permits calls

[go-nuts] Re: x/mobile: How to generate a builtin error type binding by gobind command?

2016-06-27 Thread Elias Naur
You can't, at least not yet. The use of the builtin error type is an implementation detail of CL 24100 which is about how errors and exceptions are represented in the generated bindings. The CL does make the path toward exposing error to the native languages easier in the future. - elias On M

Re: [go-nuts] TLS

2016-06-27 Thread Sam Whited
On Mon, Jun 27, 2016 at 9:42 AM, Konstantin Khomoutov wrote: > Sure, the standard package crypto/tls has tests, and your installation > of Go comes with full source code of the Go standard library. Reading the source is not the same as documentation or examples; please don't confuse the two. This

Re: [go-nuts] TLS

2016-06-27 Thread Konstantin Khomoutov
On Mon, 27 Jun 2016 20:04:52 +0600 Oleg Puchinin wrote: > Thank you, Dave ! > Mybe you have simple sample for my ? > Server and client initialization. Sure, the standard package crypto/tls has tests, and your installation of Go comes with full source code of the Go standard library. -- You rec

Re: [go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread Jan Mercl
On Mon, Jun 27, 2016 at 4:16 PM wrote: > After running several times the system file cache becomes very large File caches usually try to use any unused RAM the system has. If you write xGB of data to some file(s) and there is at least xGB of idle RAM in the system, I'd expect the system to cache

[go-nuts] Why there's no arithmetic process for sets?

2016-06-27 Thread Wang Yarco
First, i should say very sorry to you, guys. (It is also not for golang itself, but i think you may have interests on this. Just for some advice) Original Post When i'm reading something about sets operators, i feel strange when

Re: [go-nuts] Trying to dynamically find interfaces

2016-06-27 Thread Jan Mercl
On Mon, Jun 27, 2016 at 4:16 PM David Koblas wrote: type BaseAppController struct { *Application IGet IList } The above means that every instance of BaseAppController satisfies both the IGet and IList interfaces and that is known st

[go-nuts] x/mobile: How to generate a builtin error type binding by gobind command?

2016-06-27 Thread tenntenn
Hi, all. In order to understand how gomobile bind works, I tried to run commands (gobind, go build and etc.) step by step. But I could not generate a builtin error type binding by gobind command. This change makes to be able to generate builtin error type bindings by gomobile bind command. https

[go-nuts] Trying to dynamically find interfaces

2016-06-27 Thread David Koblas
I've got a program that is trying to implement functions on "subclasses", where the parent can check to see if the interface is implemented. For perspective, it's really dealing with REST URL generation based on if methods exist. What I'm running into is that based on the following pattern, bot

[go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread feng19910104
*go code* package main import ( "fmt" "net/http" "os" "time" ) var logCtxCh chan *http.Request var accessLogFile *os.File type HandlerHttp struct{} func (this *HandlerHttp) ServeHTTP(w http.ResponseWriter, req *http.Request) { sendAccessLog(req) w.Write([]byte("Hello W

[go-nuts] Example to write web application in golang doc needs to be corrected

2016-06-27 Thread madhusudhan . sitcs
Hi All, Example to write web application https://golang.org/doc/articles/wiki/#tmp_10 https://golang.org/doc/articles/wiki/final.go needs to be corrected to fix an error leading to 'http: multiple response.WriteHeader calls'. In the renderTemplate() func if there is an error while exectuing th

Re: [go-nuts] Are there any gmail imap golang WORKING sample ?

2016-06-27 Thread emersion
The preferred method to login to Gmail's IMAP & SMTP server is with SASL XOAUTH2. You should use it instead of app-specific passwords. On Tuesday, March 17, 2015 at 2:35:56 PM UTC+1, Hugo Schmitt wrote: > > If anyone arrives at this in 2015, for connecting in Gmail I had two > surprises: > > 1-

Re: [go-nuts] TLS

2016-06-27 Thread Oleg Puchinin
Thank you, Dave ! Mybe you have simple sample for my ? Server and client initialization. Oleg. 2016-06-27 16:53 GMT+06:00 Dave Cheney : > tls.Dial is what you should use. It's the same as net.Dial, except it > expects the remote end to speak TLS. > > On Monday, 27 June 2016 20:48:06 UTC+10, Oleg

Re: [go-nuts] golang poll/epoll/select

2016-06-27 Thread Michael Soulier
On Saturday, June 25, 2016 at 9:03:59 PM UTC-4, Michael Soulier wrote: > > Hmm. Maybe I misunderstand how runsv connects the two. A simple shell test > seems to behave more as expected. I'll need to dig. > > I think I found it. On read I'm getting "resource temporarily unavailable", so I suspect

[go-nuts] Re: Porting Go to New Platforms

2016-06-27 Thread distributed
Hi Efraim You can take a binary built for linux/386, copy it to a QNX system and run it. The QNX loader will load and execute these binaries. Of course the program will not get very far during its execution, I think it crashes at the first "int $0x80" instruction, which is to be expected. This

Re: [go-nuts] Is it safe enough to read uint without lock/atomic operation?

2016-06-27 Thread 苏沛
So data race may occur in len(someChan) ? Channel len is volatile. func reflect_chanlen(c *hchan) int { if c == nil { return 0 } return int(c.qcount) } 2016-06-27 11:58 GMT+08:00 Jan Mercl <0xj...@gmail.com>: > On Mon, Jun 27, 2016 at 5:44 AM 苏沛 wrote: >

Re: [go-nuts] TLS

2016-06-27 Thread Dave Cheney
tls.Dial is what you should use. It's the same as net.Dial, except it expects the remote end to speak TLS. On Monday, 27 June 2016 20:48:06 UTC+10, Oleg Puchinin wrote: > > I want connect to my TCP server from my client use tls. > > 2016-06-27 16:44 GMT+06:00 Dave Cheney >: > >> If you want to ma

Re: [go-nuts] TLS

2016-06-27 Thread Oleg Puchinin
I want connect to my TCP server from my client use tls. 2016-06-27 16:44 GMT+06:00 Dave Cheney : > If you want to make a connection to a server take speaks TLS, you can use > https://godoc.org/crypto/tls#Dial > > If you want to make a connection to a web server that uses HTTPS, the > net/http pac

Re: [go-nuts] TLS

2016-06-27 Thread Dave Cheney
If you want to make a connection to a server take speaks TLS, you can use https://godoc.org/crypto/tls#Dial If you want to make a connection to a web server that uses HTTPS, the net/http package does this automatically for you. If you can share some more details about what you are trying to do,

[go-nuts] TLS

2016-06-27 Thread Oleg Puchinin
Hello ! How to start use tls for TCP connection ? Oleg. -- 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 option

[go-nuts] my own lib

2016-06-27 Thread Oleg Puchinin
Hello ! How do I publish my project right? One file for now. https://sourceforge.net/projects/opgolib/?source=navbar Oleg -- 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