[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

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...

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.

[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,

[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

[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

[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

[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

[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

[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

[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

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;

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

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

[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.

[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,

[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

[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

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

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

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,

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

[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

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

2016-06-27 Thread Martin Geisler
On Fri, Jun 24, 2016 at 2:54 PM, Val wrote: > The playground caches everything, so running multiple times the same program > will just serve the previously generated output. Thanks, that's good to know! Makes a lot of sense too. > Also in the playground everything is frozen

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

2016-06-27 Thread Martin Geisler
Hi Val On Fri, Jun 24, 2016 at 2:48 PM, Val wrote: > 2 implementations here : > http://www.programming-idioms.org/idiom/10/shuffle-a-list/1564/go > > As for the map iteration trick, the runtime doesn't guarantee to randomize > anything, although it often tries to, so

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

2016-06-27 Thread Kiki Sugiaman
I know this is a bit late, so perhaps you don't care anymore... Anyway, the server may not understand the "Get" method in this line: |req, err := http.NewRequest("Get", "https://"+host+".here.com:443/rest/json/flows;, nil) | On 27/06/16 08:22, mark mellar wrote: For anyone else having