Re: [go-nuts] Which benchmark case is the reliable one?

2017-04-22 Thread T L
On Sunday, April 23, 2017 at 6:08:32 AM UTC+8, Dave Cheney wrote: > > The middle one, however you should make sum exported for the most reliable > results. Thanks. Yes I just remembered that the g in the last one will escape to heap, maybe this is the reason why it is slow. -- You receiv

[go-nuts] Re: Turning unicode code string to rune

2017-04-22 Thread Ivan Kurnosov
1. Convert it to a number 2. Use `rune()` On Sunday, April 23, 2017 at 6:51:09 AM UTC+12, Tong Sun wrote: > > Hi, > > Given a unicode code string, be it "4e16", or "0x4e16", or "u4e16", how to > turn it into a single char rune? > > You can finish the code at https://play.golang.org/p/AFIEz3eJVz

[go-nuts] Find a string in a file and delete all occurences in the file

2017-04-22 Thread Vikas Kumar
Hey All, I am trying to iterate over an array, match the lines in a file and then delete all occurrences of the lines in the file. See this example. *Array* var abcd = [5]string{ "one two", "three four fix", "six", "seven eight nine ten", "eleven twelve thirteen fourteen fif

[go-nuts] Re: `go tool trace` blank page (404 + Uncaught ReferenceError: tr is not defined)

2017-04-22 Thread Dave Cheney
Fedora does the same thing. -- 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.googl

Re: [go-nuts] Which benchmark case is the reliable one?

2017-04-22 Thread Dave Cheney
The middle one, however you should make sum exported for the most reliable results. -- 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...@goog

[go-nuts] Turning unicode code string to rune

2017-04-22 Thread Tong Sun
Hi, Given a unicode code string, be it "4e16", or "0x4e16", or "u4e16", how to turn it into a single char rune? You can finish the code at https://play.golang.org/p/AFIEz3eJVz Thanks. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsub

Re: [go-nuts] Understanding the output of "go get"

2017-04-22 Thread Joshua Humphries
I did indeed try that. Same result as wiping everything from my GOPATH (except the source I am immediately working on) and doing a normal "go get ...". On Saturday, 22 April 2017 12:58:43 UTC-4, David Peacock wrote: > > On Sat, Apr 22, 2017 at 7:54 AM, Joshua Humphries > wrote: > >> I have some

[go-nuts] [ann] cct: run concurrent command lines

2017-04-22 Thread mhhcbon
hi! yet another small cli utility you might find useful if you work cross environments, *cct* lets you run multiple commands concurrently, then wait for their completion. where the two interesting commands are $ cct -add $bucket $cmd$ cct -wait [-verbose] [-keep] [-immediate] [-json] $bucket

Re: [go-nuts] Re: go test: no tests to run

2017-04-22 Thread Tong Sun
Ah!! Thanks a lot! (was planning to do next to get the correct output first, but get confused as the go output) On Sat, Apr 22, 2017 at 6:50 AM, Ian Davis wrote: > The link says "Example functions without output comments are compiled but > not executed." > > You don't appear to have the necessar

Re: [go-nuts] Understanding the output of "go get"

2017-04-22 Thread David Peacock
On Sat, Apr 22, 2017 at 7:54 AM, Joshua Humphries wrote: > I have some code for which "go get -t -v" is suddenly failing for Go 1.6, > complaining about a reference to the "context" package (added in 1.7). > > I haven't changed any of my imports, so this means a dependency has been > updated to s

Re: [go-nuts] Which benchmark case is the reliable one?

2017-04-22 Thread T L
On Sunday, April 23, 2017 at 12:20:52 AM UTC+8, Jan Mercl wrote: > > You need to define what do _you_ consider 'reliable' to get a useful > answer. > calculate the sum of a number array elements. > > On Sat, Apr 22, 2017, 17:26 T L > wrote: > >> I write a benchmark, but the results of the fo

Re: [go-nuts] Which benchmark case is the reliable one?

2017-04-22 Thread Jan Mercl
You need to define what do _you_ consider 'reliable' to get a useful answer. On Sat, Apr 22, 2017, 17:26 T L wrote: > I write a benchmark, but the results of the following 3 cases are much > different. > Which one is reliable? > > package main > > import ( > "testing" > "runtime" > ) > >

[go-nuts] Re: `go tool trace` blank page (404 + Uncaught ReferenceError: tr is not defined)

2017-04-22 Thread Pierre Neidhardt
Yes, that was it! I reported upstream (Arch Linux) and it is now fixed. 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...@googlegro

Re: [go-nuts] Re: Is everything passed as a value in Go?

2017-04-22 Thread Konstantin Khomoutov
On Tue, 18 Apr 2017 14:30:29 -0700 (PDT) st ov wrote: > Wow! Thanks everyone! > > So if I got this right, Go always makes a copy but whats actually > being copied differs by type. > > It seems that I don't need to worry about a lot of data being copied > about with the larger data structures,

[go-nuts] Which benchmark case is the reliable one?

2017-04-22 Thread T L
I write a benchmark, but the results of the following 3 cases are much different. Which one is reliable? package main import ( "testing" "runtime" ) const N = 200 * 1000 type Element int64 var sum int func Benchmark_MaybeOptimizedOut(b *testing.B) { var a [N]Element b.ResetTime

[go-nuts] 502 bad gateway gophercon.com

2017-04-22 Thread Ralph Loizzo
Anyone else getting this error? -- 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.g

[go-nuts] Understanding the output of "go get"

2017-04-22 Thread Joshua Humphries
Hello, fellow Gophers! I have some code for which "go get -t -v" is suddenly failing for Go 1.6, complaining about a reference to the "context" package (added in 1.7). I haven't changed any of my imports, so this means a dependency has been updated to suddenly require Go 1.7. I'm trying to figu

[go-nuts] Re: How to do OS Authentication in Oracle with Go?

2017-04-22 Thread Rich
I am not an Oracle guy but a sysadmin who had users that required the ability to do database queries. My company has a user management system that is fine for Linux where they go in to a web site in the company and request access, and their access is based off of roles. Normally there is a read

Re: [go-nuts] what is the best way to to convert c++ std::string to go string in cgo programing?

2017-04-22 Thread Konstantin Khomoutov
On Wed, 19 Apr 2017 01:40:39 -0700 (PDT) Frits van Bommel wrote: > On Wednesday, April 19, 2017 at 9:10:16 AM UTC+2, hui zhang wrote: > > > > for 1) you mean > >> > >> char *CGetPath() { > >> return getpath().c_str(); > >> } > > > > > > this code will work ? > > > > That depends on wheth

Re: [go-nuts] Re: go test: no tests to run

2017-04-22 Thread Ian Davis
On Sat, 22 Apr 2017, at 02:51 AM, Tong Sun wrote: > I'm afraid that you are wrong at both points. > > - tests needn't have to use the the *same *package name, in this case > *package pybr *is good, but *package pybr_test *is good as well.> - func > TestXxx is not the only signature allowed, se

[go-nuts] Re: How to do OS Authentication in Oracle with Go?

2017-04-22 Thread Didier Spezia
The OP probably means connecting to Oracle from an "externally identified" user. Oracle can delegate the authentication to the OS providing the connection is done from a given OS user (already authenticated by the system). Normally, with OCI, you can connect by passing empty strings for user an