Re: [go-nuts] cpu profiling in CGO

2017-01-15 Thread Ian Lance Taylor
On Sun, Jan 15, 2017 at 6:44 PM, Yucong Sun wrote: > Thanks! Indeed, my program spends majority of time in C code. So for 1.8, > would the profiling actually include C/C++ funciton informations? It should, yes. Ian -- You received this message because you are subscribed to the Google Groups "

[go-nuts] Confuse about google.org/x/net/oauth

2017-01-15 Thread 叶志辉
Here is my scene, I am writing an OAuth service for my system, and is willing to use standard library golang.org/x/net/oauth to encode/verify client credentials.I know that google's cloud platform api is also using this library. There is a little confuse for me. I just want to implement

Re: [go-nuts] cpu profiling in CGO

2017-01-15 Thread Yucong Sun
Thanks! Indeed, my program spends majority of time in C code. So for 1.8, would the profiling actually include C/C++ funciton informations? That's actually a major incentive for me to use Go, because it saves so much time reinventing the wheel on tasks like this On Sun, Jan 15, 2017 at 5:47 PM Ia

Re: [go-nuts] Re: How are Go talk slides created?

2017-01-15 Thread Dave Cheney
Can you please post the entire slide in a gist or other pastebin service. I'll tell you where the error is. On Mon, Jan 16, 2017 at 1:21 PM, 赵成兵 wrote: > Hello , How do you correct the error unexpected EOF when do present xxx.slide? > Seems nothing wrong about the format of the slide file. > > --

Re: [go-nuts] Re: How are Go talk slides created?

2017-01-15 Thread 赵成兵
Hello , How do you correct the error unexpected EOF when do present xxx.slide? Seems nothing wrong about the format of the slide file. -- 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 i

Re: [go-nuts] cpu profiling in CGO

2017-01-15 Thread Ian Lance Taylor
On Sun, Jan 15, 2017 at 1:04 AM, Yucong Sun wrote: > > Sorry for replying late. > > 1: operating system is linux > 2. golang 1.7 > 3. I'm statically linking Go with C++ code, so I guess that is > -buildmode=c-archive. With 1.7, if your program spends most of its time in C code that runs in threa

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-15 Thread Henry
This is why I prefer to expose my type through an interface and let others access the type variables through its methods. I just need to make sure the variables are properly initialized when accessed, and the rest of the code does not need to be littered with nil check. -- You received this me

Re: [go-nuts] Question on rune literals in golang spec

2017-01-15 Thread Rob Pike
It cannot; that's why it's an error if attempted. The parenthesized phrase is redundant but explanatory. -rob On Mon, Jan 16, 2017 at 10:44 AM, wrote: > "If the source code represents a character as two code points, such as a > combining form involving an accent and a letter, the result will

Re: [go-nuts] Sort bitcoin addresses

2017-01-15 Thread Stas Maksimov
I'm not really sure what you are asking here. Why the number of pages should decrease at all? The number of pages in this app is total number of bitcoins divided by 128 results per page. Granted it's an incredibly big number, but it shouldn't change as you travel between pages. All addresses seem

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-15 Thread oelmekki
As a side note, I'm probably stating the obvious here, but this is only a problem because your type is `*Attribute`. Should it be `Attribute` instead, your struct would be properly initialized with its fields to their zero value. I mention it because I'm not sure myself why, from a design point

Re: [go-nuts] Sort bitcoin addresses

2017-01-15 Thread Stas Maksimov
Seemingly the are all starting with 1L. S. On Sun, 15 Jan 2017 at 20:13 Anonymous wrote: > What i mean is that i would like to recalculate this number so that it > only shows me the total of pages for addresses starting with 1L > > -- > You received this message because you are subscribed to th

[go-nuts] Question on rune literals in golang spec

2017-01-15 Thread spencer
"If the source code represents a character as two code points, such as a combining form involving an accent and a letter, the result will be an error if placed in a rune literal (it is not a single code point), and will appear as two code points if placed in a string literal." Am I reading this

[go-nuts] Re: Blocking waitgroup

2017-01-15 Thread Vyas Giridharan
Thanks. On Sun, Jan 15, 2017 at 2:05 AM, Dave Cheney wrote: > When your program blocks, hit control-\ and you'll get a stack trace of > every running goroutine, the ones blocked inside downPart will point to the > place they are blocked. > > > On Sunday, 15 January 2017 05:33:25 UTC+11, vyasgir..

[go-nuts] Re: Multiple libraries, init() and a request for help

2017-01-15 Thread eduncan911
Not sure when Golang added the -args option to Tests. But this now works: $ go test -cover -v -run TestEventsTableTests -args -v 3 -logtostderr true The -args parameter allows you to pass in package-level flags into the binary and test package to run. For example, the glog logging packa

[go-nuts] Re: Passing -v=10 flag to glog when running tests

2017-01-15 Thread eduncan911
Btw, I have to make a correction to my previous post (see below). This init() doesn't seem to take effect all the time (or at all in some projects). I also tried putting them into TestMain instead inside of my test files with the same "doesn't always work" result (most of the time, it does no

[go-nuts] Sort bitcoin addresses

2017-01-15 Thread Anonymous
What i mean is that i would like to recalculate this number so that it only shows me the total of pages for addresses starting with 1L -- 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

[go-nuts] Sort bitcoin addresses

2017-01-15 Thread Anonymous
Hello everyone I modified the following code: https://github.com/saracen/directory.io/blob/master/directory.go Here is the total number of pages for a display of 128 addresses: 904625697166532776746648320380374280103671755200316906558262375061821325312 I modified the code to display only the a

[go-nuts] Re: [ANN] Mutagen - A unique file sync utility in Go inspired by Unison

2017-01-15 Thread Pierre Neidhardt
I've developed a related bu complementary tool, also in pure Go: https://ambrevar.bitbucket.io/hsync/ It synchronizes hierarchies, in the sense that it will detect renames and move files on target accordingly, *without* transfering any file. It can be a huge time saver in scenarios where renamin

Re: [go-nuts] cpu profiling in CGO

2017-01-15 Thread Yucong Sun
Hi Ian, Sorry for replying late. 1: operating system is linux 2. golang 1.7 3. I'm statically linking Go with C++ code, so I guess that is -buildmode=c-archive. Thanks On Tue, Jan 10, 2017 at 1:21 PM Ian Lance Taylor wrote: > On Tue, Jan 10, 2017 at 12:52 PM, Yucong Sun wrote: > > > > I've