Re: [go-nuts] cgo1.7.1 arm: irregular execution time

2016-10-21 Thread tpoisonooo
在 2016年10月19日星期三 UTC+8下午9:19:01,Konstantin Khomoutov写道: > > On Tue, 18 Oct 2016 22:12:44 -0700 (PDT) > tpoisonooo wrote: > > > My colleague gives me a `face_recognization.so`, > > `face_recognization.so` use `libcaffe.so`. > > I compiled it with cgo based on arm. >

[go-nuts] x/crypto/salsa20: Stream mode instead of message mode

2016-10-21 Thread kubuxu
The docs for salsa20 in x/crypto say (https://godoc.org/golang.org/x/crypto/salsa20): Salsa20 differs from many other stream ciphers in that it is message > orientated rather than byte orientated. Keystream blocks are not preserved > between calls, therefore each side must encrypt/decrypt data

Re: [go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-21 Thread 'Axel Wagner' via golang-nuts
On Fri, Oct 21, 2016 at 11:08 PM, Ronny Bangsund wrote: > On Thursday, October 20, 2016 at 5:45:03 AM UTC-0:8, zixu mo wrote: >> >> Golang should have a center packages index hosting like npm, rust crates. >> > It seems some posters didn't notice the distinction you

[go-nuts] Amplifying effects of TLS connection flood

2016-10-21 Thread Ben Burkert
Hi folks, This started out as a response to the 'http ssl "can't identify protocol"' thread but encompasses more than the original discussion: https://groups.google.com/d/msg/golang-nuts/FeI0f4TBhWk/hkWKrDNpAgAJ I have also noticed a similar problems with high numbers of TCP connections in the

Re: [go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Mehrdad Arshad Rad
fixed by golang/go@b7c7949 On Friday, October 21, 2016 at 10:41:33 AM UTC-7, Ian Lance Taylor wrote: > > On Fri, Oct 21, 2016 at 8:08 AM, Pietro Gagliardi > wrote: > > So the trigger was that

[go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-21 Thread Ronny Bangsund
On Thursday, October 20, 2016 at 5:45:03 AM UTC-0:8, zixu mo wrote: > > Golang should have a center packages index hosting like npm, rust crates. > It seems some posters didn't notice the distinction you made there ;) The OP asked about an *index*, not a central repository. It would basically be

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Nate Finch
Perhaps regular was the wrong choice of phrasing. From an end-user's perspective, it makes the language more consistent, rather than having {v} work for some of the more complex values of T, but not for the more simple values of T. On Fri, Oct 21, 2016 at 3:59 PM Jan Mercl <0xj...@gmail.com>

[go-nuts] [ANN] AXIS VFS - Simple, lightweight, virtual file system API

2016-10-21 Thread milo . christiansen
AXIS VFS public repository Today I am proud to announce the public release of AXIS VFS, a simple and lightweight virtual file system API. AXIS' intended purpose is to abstract file IO so that the client program does not need to know anything about the

[go-nuts] Is it possible for src/make.* to detect and warn users if their prepackaged source tree mixes 1.x and 1.y?

2016-10-21 Thread Pietro Gagliardi
This seems to be a common issue where people confuse problems building Go programs with problems building Go because they do an in-place upgrade from the prepackaged source, causing go build to mix, say, 1.5 and 1.6 files that are not compatible. https://github.com/andlabs/ui/issues/185

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Jan Mercl
On Fri, Oct 21, 2016 at 9:20 PM Nate Finch wrote: > And, I would argue, it actually makes the language slightly more regular, since now {v} works for just about everything (possibly everything?). Taking the address of an addressable thing is the regular proper. Taking

[go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-21 Thread Sri G
Pros: + Getting stats on popular packages and code. Keeping anonymity should be like apt on debian/ubuntu by requesting permission for anonymous stats reporting. + Showing Go's popularity and increasing community and adoption Cons: - Having a central point of failure for pulling repos.. Look

[go-nuts] Re: interface as valid method receivers ?

2016-10-21 Thread paraiso . marc
> there is ambiguity as to what is called. Sorry I meant there *NO *ambiguity as to what is called. Le mardi 18 octobre 2016 20:12:17 UTC+2, parais...@gmail.com a écrit : > > Obviously in Go this is a compile time error : > > type Foo interface {} > > > func (f Foo) DoSomething(){} > > > I

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Nate Finch
That's fair. But I think it's a worthwhile (and fairly minor) complexity to add to the spec to make the language a lot easier to use in some very common use cases. And, I would argue, it actually makes the language slightly more regular, since now {v} works for just about everything

Re: [go-nuts] Re: Duplicate File Checker Performance

2016-10-21 Thread Sri G
Yea :/ Appreciate you sharing your project and your code! I learned a lot of useful Go patterns (referencing a fixed size byte buffer as a slice) and how to re-use byte buffers like in the python version to keep memory usage down. On Sunday, October 16, 2016 at 4:32:34 PM UTC-4, Michael Jones

[go-nuts] Re: interface as valid method receivers ?

2016-10-21 Thread paraiso . marc
Hey folks, what a great discussion. To be clear, if something like that would exist, it should have obvious limitation, like any Go features regarding structs and interfaces. It would be illegal to do that for instance : type Foo interface { Do() } func (f Foo)interface Do(){} Now I don't

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 11:39 AM, Nate Finch wrote: > I don't think it's ambiguous at all. We already do different things for > different T in T{v}. For slices, the slice is constructed and then each > value is an item in the slice. For structs, the struct is constructed

Re: [go-nuts] Re: Loops over sorted array, sort.Sort used as value

2016-10-21 Thread Tong Sun
Gotya. Thank you both. On Fri, Oct 21, 2016 at 2:38 PM, Roberto Zanotto wrote: > https://play.golang.org/p/i7l6VAITC1 > > > On Friday, October 21, 2016 at 8:20:38 PM UTC+2, Tong Sun wrote: >> >> Hi, >> >> How to loop over sorted array? >> >> I got "sort.Sort used as value"

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Nate Finch
I don't think it's ambiguous at all. We already do different things for different T in T{v}. For slices, the slice is constructed and then each value is an item in the slice. For structs, the struct is constructed and then the fields are filled out in declaration order. We're just adding

[go-nuts] Re: Loops over sorted array, sort.Sort used as value

2016-10-21 Thread Roberto Zanotto
https://play.golang.org/p/i7l6VAITC1 On Friday, October 21, 2016 at 8:20:38 PM UTC+2, Tong Sun wrote: > > Hi, > > How to loop over sorted array? > > I got "sort.Sort used as value" error: > https://play.golang.org/p/HP30OyJVrz > > Thanks > > -- You received this message because you are

Re: [go-nuts] Loops over sorted array, sort.Sort used as value

2016-10-21 Thread Jan Mercl
sort.Sort has no return value so it cannot be used as an expression, which is what the range clause grammar expects. On Fri, Oct 21, 2016, 20:20 Tong Sun wrote: > Hi, > > How to loop over sorted array? > > I got "sort.Sort used as value" error: >

Re: [go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 8:08 AM, Pietro Gagliardi wrote: > So the trigger was that there is both a pointer and a C.xxx name in the same > argument list? Yes. Ian >> On Oct 21, 2016, at 10:56 AM, Ian Lance Taylor wrote: >> >> On Fri, Oct 21, 2016 at 7:07

Re: [go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 10:40 AM, Ian Lance Taylor wrote: > On Fri, Oct 21, 2016 at 8:08 AM, Pietro Gagliardi wrote: >> So the trigger was that there is both a pointer and a C.xxx name in the same >> argument list? > > Yes. Well, not just any pointer, but

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Caleb Spare
"goference" On Fri, Oct 21, 2016 at 10:13 AM, Ian Lance Taylor wrote: > On Fri, Oct 21, 2016 at 8:59 AM, T L wrote: >> >> Is it a good idea to remove the reference words from faq? >> Go spec did this 3 years ago. > > The question makes sense and needs an

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 9:49 AM, Nate Finch wrote: > > I'd really like to see the composite literal syntax extended to work with > non-composite types, so you could do something like this: > > f := Foo{ Count: {5} } That doesn't work as is, because &[]interface{nil} is

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Caleb Spare
I would also like an easier way to construct pointers to ints/bools/strings. Note that there is a way to write convoluted code that makes e.g. {3} legal: https://play.golang.org/p/leP5_12IX0 AFAICT this isn't a backwards-compatibility concern, though. Like you, I would really like &5 to work but

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 8:59 AM, T L wrote: > > Is it a good idea to remove the reference words from faq? > Go spec did this 3 years ago. The question makes sense and needs an answer. If someone can rewrite it to avoid the use of the word "reference" while also making it

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Nate Finch
I had missed that, thanks. The one response does not really fit the problem, though. There are a lot of times when POS (plain old structs) make a really nice UX (or would, if they weren't a pain to handle). I like option types like Dave said, but that's really a whole different beast that

Re: [go-nuts] allow {3}, {true} etc

2016-10-21 Thread Konstantin Khomoutov
On Fri, 21 Oct 2016 09:49:24 -0700 (PDT) Nate Finch wrote: > One of the problems with working with serialization of any kind is > dealing with unset vs the zero value. The usual way to get around > this is to use a pointer, nil is unset, non-nil is set. But this > gets

[go-nuts] allow {3}, {true} etc

2016-10-21 Thread Nate Finch
One of the problems with working with serialization of any kind is dealing with unset vs the zero value. The usual way to get around this is to use a pointer, nil is unset, non-nil is set. But this gets annoying when trying to make literal values, because you can't take the address of a

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread 'Alan Donovan' via golang-nuts
I am now enlightened as to why my colleagues were so eager to banish this term from our documentation. On 21 October 2016 at 11:59, T L wrote: > > > On Friday, October 21, 2016 at 9:40:09 PM UTC+8, Ian Lance Taylor wrote: > >> On Thu, Oct 20, 2016 at 10:47 PM, T L

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread T L
On Friday, October 21, 2016 at 11:37:21 PM UTC+8, Paul Borman wrote: > > I think you should clarify that this is because T *only* contains > pointers. If T were: > > type T struct { > i int > p *int > } > > Ian says slice is also a reference type. This type declaration is much like

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread T L
On Friday, October 21, 2016 at 9:40:09 PM UTC+8, Ian Lance Taylor wrote: > > On Thu, Oct 20, 2016 at 10:47 PM, T L > wrote: > > > > On Friday, October 21, 2016 at 1:11:32 AM UTC+8, Ian Lance Taylor wrote: > >> > >> On Thu, Oct 20, 2016 at 6:47 AM, T L

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread 'Paul Borman' via golang-nuts
Well, from that standpoint, any structure that has a pointer is a reference type. On Fri, Oct 21, 2016 at 8:50 AM, T L wrote: > > > On Friday, October 21, 2016 at 11:37:21 PM UTC+8, Paul Borman wrote: >> >> I think you should clarify that this is because T *only* contains

[go-nuts] Re: URL prefix for Go's "present"

2016-10-21 Thread T L
Do you want to host your talks under your own doamin? Please read the docs: https://github.com/golang/talks, (the present folder is here: https://github.com/golang/tools) You can deploy it on app engine. But the app is simple, it should be easy to deploy it elsewhere. On Friday, October 21,

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread 'Paul Borman' via golang-nuts
I think you should clarify that this is because T *only* contains pointers. If T were: type T struct { i int p *int } then it would suddenly become non-reference type, as defined in this thread, as a change to i will not be noticed by other copies of a given T. -Paul On Fri, Oct

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread T L
On Friday, October 21, 2016 at 11:20:44 PM UTC+8, Alan Donovan wrote: > > On 21 October 2016 at 11:15, T L wrote: >> >> On Friday, October 21, 2016 at 10:01:43 PM UTC+8, Ian Lance Taylor wrote: >>> >>> On Fri, Oct 21, 2016 at 6:52 AM, Henrik Johansson

Re: [go-nuts] Are short variable declarations necessary?

2016-10-21 Thread T L
On Friday, October 21, 2016 at 4:31:51 AM UTC+8, gri wrote: > > To answer the subject line question: No, short variable declarations are > not technically necessary. We could have chosen not to have them. But there > are good reasons for them. It was a deliberate design decision. > > Let me

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread 'Alan Donovan' via golang-nuts
On 21 October 2016 at 11:15, T L wrote: > > On Friday, October 21, 2016 at 10:01:43 PM UTC+8, Ian Lance Taylor wrote: >> >> On Fri, Oct 21, 2016 at 6:52 AM, Henrik Johansson >> wrote: >> > The confusion I have had is rather with nilability. >> > A channel

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread T L
On Friday, October 21, 2016 at 9:53:14 PM UTC+8, Henrik Johansson wrote: > > The confusion I have had is rather with nilability. > A channel can be nil even though it is not explicitly a pointer. > Someone think pointers should be distinguished from channel/map/slice/interface/function. For

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread T L
On Friday, October 21, 2016 at 10:01:43 PM UTC+8, Ian Lance Taylor wrote: > > On Fri, Oct 21, 2016 at 6:52 AM, Henrik Johansson > wrote: > > The confusion I have had is rather with nilability. > > A channel can be nil even though it is not explicitly a pointer. > > It's

Re: [go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Pietro Gagliardi
So the trigger was that there is both a pointer and a C.xxx name in the same argument list? > On Oct 21, 2016, at 10:56 AM, Ian Lance Taylor wrote: > > On Fri, Oct 21, 2016 at 7:07 AM, Pietro Gagliardi wrote: >> >> Just >> >> go get -u -v

Re: [go-nuts] Re: Are short variable declarations necessary?

2016-10-21 Thread Jan Mercl
On Fri, Oct 21, 2016 at 4:20 PM Art Mellor < art-googlep...@dontsharemyemail.com> wrote: > x := FooProduce() var x = FooProduce() // Does the same, where applicable. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: Are short variable declarations necessary?

2016-10-21 Thread Art Mellor
One other use for := that I have seen (although I'm not necessarily a fan of this use) is to allow a function in a package to return a non-exported typed object. E.g. package foo type hidden struct {...} func FooProduce() *hidden {...} func FooConsume(h *hidden){...} --

Re: [go-nuts] Re: There has no Mutex.Trylock() implemention or similar method ?

2016-10-21 Thread Henrik Johansson
There was a long thread just recently about SpinLocks and the memory model. There are several implementations on github. I cannot vouch for the quality of any of them. fre 21 okt. 2016 kl 16:14 skrev Roberto Zanotto : > Maybe you can solve this with atomics. > You keep an

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Henrik Johansson
Yes and once that was clear it quickly became familiar but to people from other languages (a mix between Java and C perhaps) it can be confusing. At first it bummed me out that these where special but it is easy to get used to it. fre 21 okt. 2016 kl 16:01 skrev Ian Lance Taylor

[go-nuts] Re: There has no Mutex.Trylock() implemention or similar method ?

2016-10-21 Thread Roberto Zanotto
Maybe you can solve this with atomics. You keep an int32 that acts as mutex (0 is unocked, 1 is locked), the Trylock is done with atomic.CompareAndSwapInt32(mu, 0, 1) and the Unlock with atomic.StoreInt32(mu, 0). This gives you a Trylock, but you lose the standard (blocking) Lock. You may have

Re: [go-nuts] Re: undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 6:57 AM, Pietro Gagliardi wrote: > Regression by Go commit a16954b8a7d66169760fb60dd7f3d4e400a5e98c. Not sure > what a simpler reproduction is, but I have an idea... Can you tell me how to reproduce the problem? I don't need a simple way to reproduce

Fwd: [go-nuts] Re: undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Pietro Gagliardi
(Once again I hit Reply instead of Reply-All. Is there a way to make OS X Mail not be dumb about mailing lists?) > Begin forwarded message: > > From: Pietro Gagliardi > Subject: Re: [go-nuts] Re: undefined: C in C.PCAP_NETMASK_UNKNOWN > Date: October 21, 2016 at 10:06:55

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Ian Lance Taylor
On Fri, Oct 21, 2016 at 6:52 AM, Henrik Johansson wrote: > The confusion I have had is rather with nilability. > A channel can be nil even though it is not explicitly a pointer. It's a basic design decision in Go that every type has a zero value. For the "reference types"

Re: [go-nuts] Re: undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Pietro Gagliardi
Regression by Go commit a16954b8a7d66169760fb60dd7f3d4e400a5e98c. Not sure what a simpler reproduction is, but I have an idea... > On Oct 21, 2016, at 7:31 AM, sergobot...@gmail.com wrote: > > +1, I have same error but with glfw, not gopacket. > Have you found any solution yet? > > On Friday,

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Henrik Johansson
The confusion I have had is rather with nilability. A channel can be nil even though it is not explicitly a pointer. The whole "call by reference" debate is fun but usually with beer... fre 21 okt. 2016 kl 15:39 skrev Ian Lance Taylor : > On Thu, Oct 20, 2016 at 10:47 PM, T L

Re: [go-nuts] Tooling experience feedback

2016-10-21 Thread Mathieu Lonjaret
As you said, sometimes one is not sure in which X for "go help X" one might find the information they're looking for. So one can end up trying several of them before finding the relevant info. I can think of one way that would alleviate that pain a bit: something like a "go help all" command that

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Ian Lance Taylor
On Thu, Oct 20, 2016 at 10:47 PM, T L wrote: > > On Friday, October 21, 2016 at 1:11:32 AM UTC+8, Ian Lance Taylor wrote: >> >> On Thu, Oct 20, 2016 at 6:47 AM, T L wrote: >> > >> > On Thursday, October 20, 2016 at 4:46:52 PM UTC+8, Dave Cheney wrote: >>

Re: [go-nuts] There has no Mutex.Trylock() implemention or similar method ?

2016-10-21 Thread Jan Mercl
On Fri, Oct 21, 2016 at 3:05 PM Michael Liu wrote: It's possible to model a lock using a semafor. Semafor can be implemented by a channel. The select statement can be then used for the "tryLock" operation. -- -j -- You received this message because you are subscribed

[go-nuts] There has no Mutex.Trylock() implemention or similar method ?

2016-10-21 Thread Michael Liu
I've a race scenario used with Mutex.Lock with Lock() and Unlock(). now multi-routines try to lock the resource and start a few logical code if the Lock.Lock() succesfully. other routines don't need to block util Lock.Unlock() that they can do the above logicals with next time or in

[go-nuts] Re: undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread sergobot256
+1, I have same error but with glfw, not gopacket. Have you found any solution yet? On Friday, October 21, 2016 at 7:36:30 AM UTC+3, Mehrdad Arshad Rad wrote: > > Hi, > > Today I noticed the travis-ci fails once it tries to build myLG > w/ latest Go

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Marvin Renich
* T L [161021 01:47]: > This faq, "Why are maps, slices, and channels references while arrays are > values?", https://golang.org/doc/faq#references. > thinks maps, slices, and channels are references. I think the "references" > here means "reference values". That's not the

Re: [go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-21 Thread Konstantin Khomoutov
On Thu, 20 Oct 2016 21:35:06 -0700 (PDT) Mehrdad Arshad Rad wrote: > Today I noticed the travis-ci fails once it tries to build myLG > w/ latest Go version:devel > +7ea5829 and shows below errors. > > The command "eval go get -t -v

[go-nuts] URL prefix for Go's "present"

2016-10-21 Thread Torsten Bronger
Hallöchen! I'm about to write a talk with Go's "present" tool. Currently, the slides reside at a domain of mine at the root. However, it would be much more practical to be able to move the "present" URL to "http://example.com/mytalks/;. Unfortunately, all URLs that "present" generates lack the

[go-nuts] Re: How to build my own godoc

2016-10-21 Thread FancyGo
I have solved my problem. Build godoc in tools/cmd instead tools can solve. 在 2016年10月20日星期四 UTC+8下午11:48:57,FancyGo写道: > > Hi all, I have download source code of godoc. But I have no idea how to > build it. Because I have modified the source code, so I don't want use the > bin godoc. > --