Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-22 Thread nealhoo
Thanks for your attention. Here is the code : https://gist.github.com/lrita/efa8c4ae555b4b7cceee29b4ed819652 When I run `go test -v -race -count=10 .` `TestSyncAPI` reports DATA RACE, `TestSyncAPI2` not reports. 在 2018年8月22日星期三 UTC+8下午10:34:35,Ian Lance Taylor写道: > > On Wed, Aug 22, 2018 at 3:

[go-nuts] Go 1.11 Release Candidate 2 is released

2018-08-22 Thread Andrew Bonventre
Hello gophers, We have just released go1.11rc2, a release candidate version of Go 1.11. It is cut from release-branch.go1.11 at the revision tagged go1.11rc2. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable. Re

Re: [go-nuts] Re: help with using crc32.Update for BE data.

2018-08-22 Thread Dan Kortschak
Thanks Mikioh. Yes, that's what I've done. Unfortunate. Dan On Wed, 2018-08-22 at 17:21 -0700, mikioh.mik...@gmail.com wrote: > looks like the hash/crc32 package in the standard library focuses on > the  > processing reversed bits, as the opposite of normal bits as defined > in  > https://tools.i

Re: [go-nuts] help with using crc32.Update for BE data.

2018-08-22 Thread Dan Kortschak
No, I don't think that works. Dan On Wed, 2018-08-22 at 12:04 +0200, Jan Mercl wrote: > On Wed, Aug 22, 2018 at 7:23 AM Dan Kortschak .edu.au> > wrote: > > > > > https://stackoverflow.com/questions/51960305/convert-crc32-sum-from > > - > lsb-first-algorithm-to-sum-for-msb-first-algorithm >

[go-nuts] Re: help with using crc32.Update for BE data.

2018-08-22 Thread mikioh . mikioh
looks like the hash/crc32 package in the standard library focuses on the processing reversed bits, as the opposite of normal bits as defined in https://tools.ietf.org/html/rfc4326#section-4.6. On Sunday, August 19, 2018 at 8:58:05 AM UTC+9, kortschak wrote: > > information (though intuitively it

[go-nuts] Re: function's argument default value

2018-08-22 Thread Louki Sumirniy
There is a default value for everything in Go. Null. 0, "" and nil. As someone else said, if you want a parameter to be optional you probably need ...interface{} and then infer no parameter as 'use the default'. Going a little further, you can build default values into a constructor function fo

Re: [go-nuts] Unsafe Pointer rules

2018-08-22 Thread Louki Sumirniy
It seems to me the only way to achieve this would be to allocate a []byte twice the size you need, to be sure, then get the address of the start and offset it (if necessary) until it is a number (as in uintptr) divisible by 16, then it would be correctly structured. I would think you will find t

Re: [go-nuts] Local cache of dependencies

2018-08-22 Thread Conor Hackett
Thanks Sam, I'll have a look out of curiosity but I am very reluctant to introduce/recommend Git submodules to any of my projects. You might say it's because I don't understand how they work that I fear them but they have caused much heartache in the past and a recent team I was on had nothing

Re: [go-nuts] Local cache of dependencies

2018-08-22 Thread Sam Vilain
Check out vendetta - it uses git submodules, so you keep a cache of the 3rd party repo in git but not the actual content. You get small repos and reproducible builds.SamOn Aug 22, 2018 3:25 PM, Conor Hackett wrote:Hey Guys,So, adding your "vendor" directory to SCM is a contentious topic at best.I

[go-nuts] Local cache of dependencies

2018-08-22 Thread Conor Hackett
Hey Guys, So, adding your "vendor" directory to SCM is a contentious topic at best. I personally would rather not vendor the dependencies but I do need to keep the required code in my control and I consider third party repos out of my control. Similar to how maven works (and others I am sure),

[go-nuts] net/http connection specific headers

2018-08-22 Thread abohra
The protocol I am working with requires the client to sign authorization headers using key material extracted from the TLS session (RFC 5705). What is the best way of populating request headers after the persistConn is known and associated with the Transport? Thanks Aniruddha -- You received t

Re: [go-nuts] Unsafe Pointer rules

2018-08-22 Thread peterGo
On Tuesday, August 21, 2018 at 7:08:43 PM UTC-4, Carl Mastrangelo wrote: > > The answer must be more nuanced than that, because it is possible to take > a nil pointer and construct an unsafe.Pointer from it. > > The reason I am interested in this is (and please don't judge too early) > is I'm t

Re: [go-nuts] function's argument default value

2018-08-22 Thread Wojciech S. Czarnecki
On Wed, 22 Aug 2018 08:09:14 -0700 (PDT) Marvin Stenger wrote: > : A pony. Seven-legged, with three tails, lacking head. (Excuse me, list, just could not resist.) @Marvin: Go uses the default of zero. What you proposed would

Re: [go-nuts] Unsafe Pointer rules

2018-08-22 Thread peterGo
On Tuesday, August 21, 2018 at 7:08:43 PM UTC-4, Carl Mastrangelo wrote: > > > The reason I am interested in this is (and please don't judge too early) > is I'm toying around with implementing some atomic primitives. In > particular, I would like to play around with with the cmpxchg16b > instru

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-22 Thread Ian Lance Taylor
On Wed, Aug 22, 2018 at 8:20 AM, 'Florian Uekermann' via golang-nuts wrote: > On Tuesday, August 21, 2018 at 7:31:28 AM UTC+2, Keith Randall wrote: >> >> There is no conservativeness to unsafe.Pointer. The type information for >> any object in the heap is recorded at allocation time, and is unrela

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-22 Thread 'Florian Uekermann' via golang-nuts
On Tuesday, August 21, 2018 at 7:31:28 AM UTC+2, Keith Randall wrote: > > There is no conservativeness to unsafe.Pointer. The type information for > any object in the heap is recorded at allocation time, and is unrelated to > the type of the reference currently held to it (be it unsafe.Pointer,

[go-nuts] Re: unsafe pointer arithmetics - slow code

2018-08-22 Thread 'Florian Uekermann' via golang-nuts
> > Another question: Why does the nil check take two instructions. Can't it > be done using MOVQ? > Scratch that. That was nonsense. -- 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] Re: unsafe pointer arithmetics - slow code

2018-08-22 Thread 'Florian Uekermann' via golang-nuts
Forgot the ssa.html -- 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/

[go-nuts] unsafe pointer arithmetics - slow code

2018-08-22 Thread 'Florian Uekermann' via golang-nuts
Dear all, I stumbled over a strange performance degradation when using unsafe pointers. I took a look at the assembly and was surprised to see a number seemingly redundant nil checks using the LEAQ and TESTB instructions. A minimal reproducer is the following function: func getOff(a *uint64, i

Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-22 Thread Ian Lance Taylor
On Wed, Aug 22, 2018 at 3:25 AM, wrote: > > When I copy the sync.Pool's source code in a repo, and using `//go:linkname` > link those runtime functions manually. > When I run `go test -race`, it reports `DATA RACE`. > But the sync.Pool with the same test case does not report `DATA RACE`. > > Doe

Re: [go-nuts] function's argument default value

2018-08-22 Thread Masoud Ghorbani
:)) ok let me show you in the following example: def sayHey(name="You"): print('Hey, {0}'.format(name)) sayHey() # Hey, You sayHey('John') # Hey, John but we don't have parameters default value like Python in Golang. if I want to do this action simply without using structs I should write th

Re: [go-nuts] function's argument default value

2018-08-22 Thread Jan Mercl
On Wed, Aug 22, 2018 at 3:20 PM Masoud Ghorbani wrote: > In my description, I used the argument title instead parameter, sorry for this confusion. Now I'm lost in translation ;-) Can you please show some code illustrating the topic? Like code written now vs code written while feature X would be

Re: [go-nuts] function's argument default value

2018-08-22 Thread Masoud Ghorbani
In my description, I used the argument title instead parameter, sorry for this confusion. On Wednesday, August 22, 2018 at 5:18:34 PM UTC+4:30, Jan Mercl wrote: > > On Wed, Aug 22, 2018 at 2:39 PM Masoud Ghorbani > wrote: > > > Why there isn't function argument default value in Golang explicitl

Re: [go-nuts] function's argument default value

2018-08-22 Thread Jan Mercl
On Wed, Aug 22, 2018 at 2:39 PM Masoud Ghorbani wrote: > Why there isn't function argument default value in Golang explicitly like Typescript and Python? What are the possible benefits? The only things that come to my mind are IMO negative. The definition of the default value is in a different p

[go-nuts] function's argument default value

2018-08-22 Thread Masoud Ghorbani
Why there isn't function argument default value in Golang explicitly like Typescript and Python? -- 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+unsu

[go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-22 Thread nealhoo
Hi, When I copy the sync.Pool's source code in a repo, and using `//go:linkname` link those runtime functions manually. When I run `go test -race`, it reports `DATA RACE`. But the sync.Pool with the same test case does not report `DATA RACE`. Does runtime.RaceDisable not work in non-std library

Re: [go-nuts] help with using crc32.Update for BE data.

2018-08-22 Thread Jan Mercl
On Wed, Aug 22, 2018 at 7:23 AM Dan Kortschak wrote: > https://stackoverflow.com/questions/51960305/convert-crc32-sum-from- lsb-first-algorithm-to-sum-for-msb-first-algorithm