[go-nuts] Go vs. the rest

2016-11-08 Thread DrGo
https://arxiv.org/pdf/1409.0252.pdf

A nice analysis showing that Go gets the balance of performance vs 
robustness right. Some aspects of the analysis are naive, like measuring 
productivity by numbers of lines. And this is using Go 1.3!!


-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Persistent http TLS connections despite timeout

2016-11-08 Thread Matt Joiner
All of the following goroutines have a corresponding file descriptor open.

515 @ 0x434c9a 0x4301d7 0x42f819 0x536fe8 0x537054 0x5387a7 0x54c0e0
0x5d5ed8 0x5d6444 0x5da116 0x691720 0x4fdd57 0x4fecbb 0x4feea7 0x61701f
0x616e1f 0x68b895 0x692afa 0x696d7a 0x460f61
# 0x42f818 net.runtime_pollWait+0x58 /root/src/go/src/runtime/netpoll.go:164
# 0x536fe7 net.(*pollDesc).wait+0x37
/root/src/go/src/net/fd_poll_runtime.go:75
# 0x537053 net.(*pollDesc).waitRead+0x33
/root/src/go/src/net/fd_poll_runtime.go:80
# 0x5387a6 net.(*netFD).Read+0x1b6 /root/src/go/src/net/fd_unix.go:250
# 0x54c0df net.(*conn).Read+0x6f /root/src/go/src/net/net.go:180
# 0x5d5ed7 crypto/tls.(*block).readFromUntil+0x97
/root/src/go/src/crypto/tls/conn.go:488
# 0x5d6443 crypto/tls.(*Conn).readRecord+0xc3
/root/src/go/src/crypto/tls/conn.go:590
# 0x5da115 crypto/tls.(*Conn).Read+0x115
/root/src/go/src/crypto/tls/conn.go:1134
# 0x69171f net/http.(*connReader).Read+0x13f
/root/src/go/src/net/http/server.go:740
# 0x4fdd56 bufio.(*Reader).fill+0x116 /root/src/go/src/bufio/bufio.go:97
# 0x4fecba bufio.(*Reader).ReadSlice+0xba
/root/src/go/src/bufio/bufio.go:338
# 0x4feea6 bufio.(*Reader).ReadLine+0x36 /root/src/go/src/bufio/bufio.go:367
# 0x61701e net/textproto.(*Reader).readLineSlice+0x5e
/root/src/go/src/net/textproto/reader.go:55
# 0x616e1e net/textproto.(*Reader).ReadLine+0x2e
/root/src/go/src/net/textproto/reader.go:36
# 0x68b894 net/http.readRequest+0xa4
/root/src/go/src/net/http/request.go:871
# 0x692af9 net/http.(*conn).readRequest+0x219
/root/src/go/src/net/http/server.go:920
# 0x696d79 net/http.(*conn).serve+0x499
/root/src/go/src/net/http/server.go:1726

Here's the specifics for just one of these goroutines:

goroutine 968618 [IO wait, 160 minutes]:
net.runtime_pollWait(0x7f6a402d2770, 0x72, 0x156)
/root/src/go/src/runtime/netpoll.go:164 +0x59
net.(*pollDesc).wait(0xc422f48d88, 0x72, 0xfbb160, 0xfb66d8)
/root/src/go/src/net/fd_poll_runtime.go:75 +0x38
net.(*pollDesc).waitRead(0xc422f48d88, 0xc421fd4000, 0x800)
/root/src/go/src/net/fd_poll_runtime.go:80 +0x34
net.(*netFD).Read(0xc422f48d20, 0xc421fd4000, 0x800, 0x800, 0x0, 0xfbb160,
0xfb66d8)
/root/src/go/src/net/fd_unix.go:250 +0x1b7
net.(*conn).Read(0xc420baf018, 0xc421fd4000, 0x800, 0x800, 0x0, 0x0, 0x0)
/root/src/go/src/net/net.go:180 +0x70
crypto/tls.(*block).readFromUntil(0xc4209ee270, 0x7f6a45f4d1c0,
0xc420baf018, 0x5, 0xc420baf018, 0x0)
/root/src/go/src/crypto/tls/conn.go:488 +0x98
crypto/tls.(*Conn).readRecord(0xc42290a700, 0xadc817, 0xc42290a820,
0x690fda)
/root/src/go/src/crypto/tls/conn.go:590 +0xc4
crypto/tls.(*Conn).Read(0xc42290a700, 0xc427867000, 0x1000, 0x1000, 0x0,
0x0, 0x0)
/root/src/go/src/crypto/tls/conn.go:1134 +0x116
net/http.(*connReader).Read(0xc429001bc0, 0xc427867000, 0x1000, 0x1000,
0xc43c11f918, 0x0, 0x0)
/root/src/go/src/net/http/server.go:740 +0x140
bufio.(*Reader).fill(0xc4202b7800)
/root/src/go/src/bufio/bufio.go:97 +0x117
bufio.(*Reader).ReadSlice(0xc4202b7800, 0xa, 0x0, 0x0, 0x0, 0x0,
0xc43c11f9f0)
/root/src/go/src/bufio/bufio.go:338 +0xbb
bufio.(*Reader).ReadLine(0xc4202b7800, 0xc42b252e00, 0x100, 0xf8, 0xaa52a0,
0xc43c11fa58, 0x474652)
/root/src/go/src/bufio/bufio.go:367 +0x37
net/textproto.(*Reader).readLineSlice(0xc42037d0e0, 0xc43c11fac0,
0xc43c11fac0, 0x418b88, 0x100, 0xaa52a0)
/root/src/go/src/net/textproto/reader.go:55 +0x5f
net/textproto.(*Reader).ReadLine(0xc42037d0e0, 0xc42b252e00, 0xc4,
0x0, 0x72)
/root/src/go/src/net/textproto/reader.go:36 +0x2f
net/http.readRequest(0xc4202b7800, 0x0, 0xc42b252e00, 0x0, 0x0)
/root/src/go/src/net/http/request.go:871 +0xa5
net/http.(*conn).readRequest(0xc428b8b180, 0xfbfba0, 0xc429001b80, 0x0,
0x0, 0x0)
/root/src/go/src/net/http/server.go:920 +0x21a
net/http.(*conn).serve(0xc428b8b180, 0xfbfba0, 0xc429001b80)
/root/src/go/src/net/http/server.go:1726 +0x49a
created by net/http.(*Server).Serve
/root/src/go/src/net/http/server.go:2608 +0x2ce

I'm running the http.Server with ConnState: timeoutIdleConns

func timeoutIdleConns(nc net.Conn, cs http.ConnState) {

switch cs {
case http.StateIdle, http.StateNew:

nc.SetReadDeadline(time.Now().Add(time.Minute))

default:

nc.SetReadDeadline(time.Time{})

}

}

>From what I can tell, this callback is triggered with StateNew, prior to
conn.serve() being created, so the ReadDeadline should be present in the
stalled goroutine calls.

What's going on?

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Re: Is it possible to bundle LuaJIT binary together with Go executable?

2016-11-08 Thread Jianfei Wang
You can try some LuaJIT bindings in Go, 
like https://github.com/aarzilli/golua. This will link a static LuaJIT 
build with your Go program so that you do not need the external binary.

However, since cgo is involved, you have dependencies on libc and all 
LuaJIT dependencies then.

On Tuesday, November 8, 2016 at 9:38:48 AM UTC+8, ChrisLu wrote:
>
> Hi,
>
> I am working on a project to start a LuaJIT process from Go.
>
> My question is whether it is possible to bundle LuaJIT binary together 
> with Go executable?
>
> If having this, this would avoid the external dependency to install LuaJIT.
>
> Chris
> --
> https://github.com/chrislusf/gleam
>
>

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Re: How to implement 2-factor-auth with x/crypto/ssh?

2016-11-08 Thread Jianfei Wang
I have to modify `x/crypto/ssh` to implement the PartialSuccess support.

https://gist.github.com/thinxer/637acd43480174fede118704f27530a6

The above gist comes with two implementations. One is to add a callback, 
another is to add a PartialSuccess error flag. The former give more control 
to the user.

These are not perfect though. Personally I'd like to abstract the 
authentication callbacks into an interface (ServerAuthenticator), and make 
the ServerConfig make a ServerAuthenticator for each SSH connection. This 
way it would be easier to implement stateful authentication processes.

On Tuesday, November 8, 2016 at 11:12:59 PM UTC+8, Jianfei Wang wrote:
>
> I'm using the `x/crypto/ssh` package to implement a custom SSH server. 
>
> I need to do 2 factor authentication: publickey and keyboard-interactive. 
>  However, it seems that I cannot make `ssh.ServerConfig` require both 
> callbacks. The SSH handshake completes when any of the callback passes.
>
> What I want is the following authentication process: first ask for a valid 
> public key, then ask for an OTP token. It seems impossible to do so with 
> x/crypto/ssh.
>
> Here's a what a properly configured OpenSSH server would do:
>
> ```
> debug1: Authentications that can continue: publickey
> debug1: Next authentication method: publickey
> debug1: Offering RSA public key: /Users/thinxer/.ssh/id_rsa
> debug1: Server accepts key: pkalg ssh-rsa blen 279
> Authenticated with partial success.
> debug1: Authentications that can continue: keyboard-interactive
> debug1: Next authentication method: keyboard-interactive
> Verification code:
> ```
>
> What I came up is the following snippet:
>
> ```
> pubkeyAccepted := false
> config := {
> PublickKeyCalllback: func(...) { 
> // check and set pubkeyAccepted, but return an error always.
> },
> KeyboardInteractiveCallback: func(...) {
> if pubkeyAccepted {
> // proceed with keyboard challenge
> }
> },
> }
> ```
>
> It works somehow. However, the client won't get a "Authenticated with 
> partial success." message with the above method.
>
> Is there any better way to implement this?
>
> Thanks!
>
>

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Re: CPU Profiling on Mac OS Sierra

2016-11-08 Thread bob . ziuchkovski
That explains it.  Thank you very much for the info.  I've confirmed that 
does indeed resolve the issue.

Bob

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Videos from DotGo 2016

2016-11-08 Thread Pablo Rozas Larraondo
Does anyone know when videos from the DotGo 2016 conference are going to be
made available? if they are... I can only find 3 of the talks at their news
site.

http://www.thedotpost.com/conference/dotgo-2016

I'm looking forward to watch Robert Griesemer's talk on prototyping
multidimensional slices.

Cheers,
Pablo

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Re: Concurrent SQL queries with PG

2016-11-08 Thread Mandolyte
One of my worst case scenarios completed in less then 21 minutes. Very 
encouraging!! 

Suppose I opened two connections each running 10 threads, would I approach 10 
minutes? I'll give this a try later this week. This is pretty exciting for me 
since I never seen this problem solved in less than *hours*.

-- 
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, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Cloudstore default bucket name - data race?

2016-11-08 Thread Chris Broadfoot
You're right, it's racy.

I'll update the sample.

file.DefaultBucketName will indeed return the same result every time
(unless the default bucket is updated in the App Engine admin console).

On Tue, Nov 8, 2016 at 12:40 PM, Greg Jones  wrote:

> You're not wrong, that code isn't a safe use of a package-level variable.
>
> On Tuesday, 8 November 2016 20:16:28 UTC, krolaw wrote:
>>
>> Hopefully someone can explain where my understanding of dataraces is
>> wrong.
>>
>> As an example, I'd like to use the appengine cloudstorage example:
>> https://cloud.google.com/appengine/docs/go/googlecloudstorag
>> eclient/app-engine-cloud-storage-sample#specifying_the_cloud
>> _storage_bucket
>>
>> When a web request comes in, it checks if the bucketname is empty.  If it
>> is, it sets the bucketname using the result from
>> file.DefaultBucketName(ctx).  It all seems like a good idea, but I'm
>> confused because the bucket name variable is accessed by multiple
>> goroutines.  What if on startup, two requests come in at roughly the same
>> time?  Would we possibly have two goroutines reading and writing to the
>> same variable?  Does the appengine guarantee that the first request
>> finishes before any other starts?  Or is this somehow a minor unimportant
>> datarace, as it is unlikely to occur and even if it does,
>> file.DefaultBucketName returns the same value... so it doesn't matter that
>> it gets called twice and sets the bucket name twice?
>>
>> Thanks and apologies for my confusion.
>>
>> --
> 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, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Jonathan Wills
jpeg does not support transparency.

On Tue, Nov 8, 2016 at 12:14 PM,  wrote:

> Hi,
>
> I'm trying to write out a png with an alpha component as a jpeg. As I
> understand it, I should be able to use the draw package to do this.
>
> // src is an image.RGBA
> newImg := image.NewRGBA(src.Bounds())
>
> draw.Draw(newImg, newImg.Bounds(), {color.White},
> image.Point{}, draw.Src)
> draw.Draw(newImg, newImg.Bounds(), src, src.Bounds().Min, draw.Over)
>
> return jpeg.Encode(w, newImg, {Quality: 85})
>
> I expected this blend the src rgb components with the white background
> using the alpha value. It appears to be ignoring the alpha value all
> together. Is this expected? I'm using go1.7.1.
>
> Thanks!
>
> --
> 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, visit https://groups.google.com/d/optout.
>

-- 
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, visit https://groups.google.com/d/optout.


Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Nigel Tao
On Wed, Nov 9, 2016 at 4:14 AM,   wrote:
> I'm trying to write out a png with an alpha component as a jpeg. As I
> understand it, I should be able to use the draw package to do this.
>
> // src is an image.RGBA
> newImg := image.NewRGBA(src.Bounds())
>
> draw.Draw(newImg, newImg.Bounds(), {color.White},
> image.Point{}, draw.Src)
> draw.Draw(newImg, newImg.Bounds(), src, src.Bounds().Min, draw.Over)
>
> return jpeg.Encode(w, newImg, {Quality: 85})
>
> I expected this blend the src rgb components with the white background using
> the alpha value. It appears to be ignoring the alpha value all together. Is
> this expected? I'm using go1.7.1.

That sounds unexpected to me too. {color.White} can just
be image.White, but that shouldn't be the problem.

What is your source image? If you load it in another image viewer or
editor, does it show transparency (usually depicted as a checkerboard
pattern)? How are you loading it, in Go? What happens if you add a
printf:

fmt.Printf("src has type %T\n", src)

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] CPU Profiling on Mac OS Sierra

2016-11-08 Thread Dave Cheney
http://talks.godoc.org/github.com/davecheney/high-performance-go-workshop/high-performance-go-workshop.slide#36

See also think linked issue at the bottom of the slide.

-- 
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, visit https://groups.google.com/d/optout.


Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Jordan Stinson
Sorry, this site:
https://www.socketloop.com/tutorials/golang-convert-png-transparent-background-image-to-jpg-or-jpeg-image

On Tue, Nov 8, 2016 at 3:24 PM, Jordan Stinson 
wrote:

> I realize that there isn't an alpha channel. My understanding is that the
> image/draw package would blend the colours according to the alpha value in
> the image and the blending equation.
>
> This site seems to suggest that it will work.
>
> On Tue, Nov 8, 2016 at 2:37 PM, Jonathan Wills 
> wrote:
>
>> jpeg does not support transparency.
>>
>> On Tue, Nov 8, 2016 at 12:14 PM,  wrote:
>>
>>> Hi,
>>>
>>> I'm trying to write out a png with an alpha component as a jpeg. As I
>>> understand it, I should be able to use the draw package to do this.
>>>
>>> // src is an image.RGBA
>>> newImg := image.NewRGBA(src.Bounds())
>>>
>>> draw.Draw(newImg, newImg.Bounds(), {color.White},
>>> image.Point{}, draw.Src)
>>> draw.Draw(newImg, newImg.Bounds(), src, src.Bounds().Min, draw.Over)
>>>
>>> return jpeg.Encode(w, newImg, {Quality: 85})
>>>
>>> I expected this blend the src rgb components with the white background
>>> using the alpha value. It appears to be ignoring the alpha value all
>>> together. Is this expected? I'm using go1.7.1.
>>>
>>> Thanks!
>>>
>>> --
>>> 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, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Re: Cloudstore default bucket name - data race?

2016-11-08 Thread Greg Jones
You're not wrong, that code isn't a safe use of a package-level variable. 

On Tuesday, 8 November 2016 20:16:28 UTC, krolaw wrote:
>
> Hopefully someone can explain where my understanding of dataraces is wrong.
>
> As an example, I'd like to use the appengine cloudstorage example: 
>
> https://cloud.google.com/appengine/docs/go/googlecloudstorageclient/app-engine-cloud-storage-sample#specifying_the_cloud_storage_bucket
>
> When a web request comes in, it checks if the bucketname is empty.  If it 
> is, it sets the bucketname using the result from 
> file.DefaultBucketName(ctx).  It all seems like a good idea, but I'm 
> confused because the bucket name variable is accessed by multiple 
> goroutines.  What if on startup, two requests come in at roughly the same 
> time?  Would we possibly have two goroutines reading and writing to the 
> same variable?  Does the appengine guarantee that the first request 
> finishes before any other starts?  Or is this somehow a minor unimportant 
> datarace, as it is unlikely to occur and even if it does, 
> file.DefaultBucketName returns the same value... so it doesn't matter that 
> it gets called twice and sets the bucket name twice?
>
> Thanks and apologies for my confusion.
>
>

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Cloudstore default bucket name - data race?

2016-11-08 Thread krolaw
Hopefully someone can explain where my understanding of dataraces is wrong.

As an example, I'd like to use the appengine cloudstorage example: 
https://cloud.google.com/appengine/docs/go/googlecloudstorageclient/app-engine-cloud-storage-sample#specifying_the_cloud_storage_bucket

When a web request comes in, it checks if the bucketname is empty.  If it 
is, it sets the bucketname using the result from 
file.DefaultBucketName(ctx).  It all seems like a good idea, but I'm 
confused because the bucket name variable is accessed by multiple 
goroutines.  What if on startup, two requests come in at roughly the same 
time?  Would we possibly have two goroutines reading and writing to the 
same variable?  Does the appengine guarantee that the first request 
finishes before any other starts?  Or is this somehow a minor unimportant 
datarace, as it is unlikely to occur and even if it does, 
file.DefaultBucketName returns the same value... so it doesn't matter that 
it gets called twice and sets the bucket name twice?

Thanks and apologies for my confusion.

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] CPU Profiling on Mac OS Sierra

2016-11-08 Thread rhys . hiltner
Try specifying the path to the binary as the second to last argument (see "go 
tool pprof -h").

On Linux as of Go 1.7, CPU profiles include information on what executables are 
mapped into memory. This allows the pprof tool to locate the binary. Raw CPU 
profiles taken on macOS don't include this information, so you need to specify 
the path to the binary by hand.

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread jordan . stinson83
Hi,

I'm trying to write out a png with an alpha component as a jpeg. As I 
understand it, I should be able to use the draw package to do this.

// src is an image.RGBA
newImg := image.NewRGBA(src.Bounds())

draw.Draw(newImg, newImg.Bounds(), {color.White}, 
image.Point{}, draw.Src)
draw.Draw(newImg, newImg.Bounds(), src, src.Bounds().Min, draw.Over)

return jpeg.Encode(w, newImg, {Quality: 85})

I expected this blend the src rgb components with the white background 
using the alpha value. It appears to be ignoring the alpha value all 
together. Is this expected? I'm using go1.7.1.

Thanks!

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Implementation status of database/sql changes

2016-11-08 Thread mattn
Hi list.

I put the Google Spreadsheet that indicate implementation status of 
database/sql changes.

* Description of the changes
https://docs.google.com/document/d/1F778e7ZSNiSmbju3jsEWzShcb8lIO4kDyfKDNm4PNd8/edit#

* Implementation status
https://docs.google.com/spreadsheets/d/1y7AzkFNPeTBado0xJJipB5MpWlcqylQg410Q5wHz2Ew/edit

If you are an author of one of the drivers, please update the below 
spreadsheet.

Thanks
- mattn

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] CPU Profiling on Mac OS Sierra

2016-11-08 Thread bob . ziuchkovski
Hi,

I am attempting to profile a Go application but keep getting empty pprof 
data with go 1.7.3 on Mac Sierra (package installer version from 
https://golang.org/dl).  The profiling output exists, but the top10 output 
is meaningless.  Profiling the same code on ubuntu 16.04 with go 1.7.3 
returns meaningful output.

I've tried profiling several different applications and I get the same 
meaningless profiling data for each on Mac OS Sierra.  The simplest 
shareable example I've tried is that of GitHub user eapache: 
https://gist.github.com/eapache/580b7dbd8800fe9a3234#file-test-go.  The 
output of that test is below:

Output on Mac OS Sierra:

$ go tool pprof profile.out
Entering interactive mode (type "help" for commands)
(pprof) top10
31.22s of 31.22s total (  100%)
  flat  flat%   sum%cum   cum%
31.22s   100%   100% 31.22s   100%

Output on Ubuntu 16.04:

$ go tool pprof profile.out 
Entering interactive mode (type "help" for commands)
(pprof) top10
21320ms of 34690ms total (61.46%)
Dropped 119 nodes (cum <= 173.45ms)
Showing top 10 nodes out of 97 (cum >= 660ms)
  flat  flat%   sum%cum   cum%
8910ms 25.68% 25.68% 8910ms 25.68%  runtime.memclr
4030ms 11.62% 37.30% 4030ms 11.62%  runtime.memmove
1860ms  5.36% 42.66% 4220ms 12.16%  runtime.sweepone
1670ms  4.81% 47.48% 1670ms  4.81%  runtime/internal/atomic.Xchg
1080ms  3.11% 50.59% 1080ms  3.11%  runtime/internal/atomic.Xadd
 880ms  2.54% 53.13%20890ms 60.22%  runtime.mallocgc
 790ms  2.28% 55.41% 1740ms  5.02%  runtime.writebarrierptr_nostore1
 730ms  2.10% 57.51%27300ms 78.70%  runtime.concatstrings
 710ms  2.05% 59.56% 1770ms  5.10%  runtime.(*mheap).allocSpanLocked
 660ms  1.90% 61.46%  660ms  1.90%  runtime.procyield


Is there anyone else running Mac OS Sierra who can check/confirm correct 
profiling functionality on Go 1.7.3?

Thanks,

Bob


-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Re: Concurrent SQL queries with PG

2016-11-08 Thread adonovan via golang-nuts
On Monday, 7 November 2016 19:54:35 UTC-5, Mandolyte wrote:
>
> Thanks for the quick response. and for your book - one of the best I've 
> ever purchased!
>
 
Thanks!  Glad it was helpful.

-- 
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, visit https://groups.google.com/d/optout.


Re: [go-nuts] Question on cmd/asm

2016-11-08 Thread aindurti
That fixes it, sorry for the silly question. Thank you very much.

On Tuesday, November 8, 2016 at 1:03:48 AM UTC-5, Ian Lance Taylor wrote:
>
> On Mon, Nov 7, 2016 at 8:58 PM,   wrote: 
> > I've been trying out Go's assembler, but I can't seem to get the most 
> basic 
> > program to compile. Following the example on https://goroutines.com/asm, 
>
> > which introduces go's assembler through an example of an add function on 
> > amd64, I get the compile error: 
> > 
> > # github.com/smasher164/asmtest 
> > ../../work/src/github.com/smasher164/asmtest/add_amd64.s:7: unexpected 
> EOF 
> > asm: assembly of ../../work/src/
> github.com/smasher164/asmtest/add_amd64.s 
> > failed 
>
> I can recreate that error if I save my copy of the assembler file 
> without a final newline.  Make sure there is a newline after RET. 
>
> Ian 
>

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] How to implement 2-factor-auth with x/crypto/ssh?

2016-11-08 Thread Jianfei Wang
I'm using the `x/crypto/ssh` package to implement a custom SSH server. 

I need to do 2 factor authentication: publickey and keyboard-interactive. 
 However, it seems that I cannot make `ssh.ServerConfig` require both 
callbacks. The SSH handshake completes when any of the callback passes.

What I want is the following authentication process: first ask for a valid 
public key, then ask for an OTP token. It seems impossible to do so with 
x/crypto/ssh.

Here's a what a properly configured OpenSSH server would do:

```
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/thinxer/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
Authenticated with partial success.
debug1: Authentications that can continue: keyboard-interactive
debug1: Next authentication method: keyboard-interactive
Verification code:
```

What I came up is the following snippet:

```
pubkeyAccepted := false
config := {
PublickKeyCalllback: func(...) { 
// check and set pubkeyAccepted, but return an error always.
},
KeyboardInteractiveCallback: func(...) {
if pubkeyAccepted {
// proceed with keyboard challenge
}
},
}
```

It works somehow. However, the client won't get a "Authenticated with 
partial success." message with the above method.

Is there any better way to implement this?

Thanks!

-- 
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, visit https://groups.google.com/d/optout.


[go-nuts] Bypassing grpc errors on Travis CI

2016-11-08 Thread Nyah Check
Hi Devs,

Currently working a basic micro service application. I'm using the grpc 
package and I'm getting this error on Travis CI 
: 
go build google.golang.org/grpc/test: no buildable Go source files in /home/
travis/gopath/src/google.golang.org/grpc/test

Is there a way to bypass this error and enable the build continue?

Also It seems the golint command not supported on version 1.5?
package golang.org/x/tools/go/gcimporter15: no buildable Go source files in 
/home/travis/gopath/src/golang.org/x/tools/go/gcimporter15

Thanks for the clarifications.

Cheers!
Nyah

-- 
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, visit https://groups.google.com/d/optout.