[go-nuts] Re: How much performance will be impacted for GC to be conservative by scanning externally allocated memory (mmap mostly desirable) for pointers ?

2018-09-20 Thread Compl Yue
Thanks for your informative reply. Compl On Friday, September 21, 2018 at 8:19:01 AM UTC+8, Keith Randall wrote: > > 1. No. Go will never scan objects outside of the Go-allocated heap. That > includes mmap'd memory. > That means you can't have pointers from such memory into the Go heap. >

[go-nuts] Re: bufio.Writer's sticky errors & lost data

2018-09-20 Thread Dean Wang
You can not suppose the data was received when the connection is corrupt. I think the destination should re-request the data it wants. HTTP implemented a similar mechanism. https://tools.ietf.org/html/rfc7233#section-3.1 Sorry for my poor english. 在 2018年9月21日星期五 UTC+8上午12:54:42,John Floren写道: >

Re: [go-nuts] Re: why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Rob Pike
PL/I is unmatched. -rob On Fri, Sep 21, 2018 at 10:13 AM Drew Derbyshire wrote: > On Wednesday, September 19, 2018 at 10:30:11 PM UTC-7, Sathish VJ wrote: >> >> I've been asked this question a few times and I haven't been able to find >> an answer. Why does go reverse the order of variable

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread John
Gotcha. Thanks Dave. Well, looks like I'm going back to my old methods for the time being. Thanks everyone! On Thursday, September 20, 2018 at 4:26:37 PM UTC-7, Dave Cheney wrote: > > Sorry, I probably wasn’t clear or didn’t understand that you were asking. > I saw that you said GOPATH is

[go-nuts] Re: How much performance will be impacted for GC to be conservative by scanning externally allocated memory (mmap mostly desirable) for pointers ?

2018-09-20 Thread keith . randall
1. No. Go will never scan objects outside of the Go-allocated heap. That includes mmap'd memory. That means you can't have pointers from such memory into the Go heap. Pointers within the mmap'd area are fine. > that also means no regular Go pointer should be defined into such structs Right.

[go-nuts] Re: why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Drew Derbyshire
On Wednesday, September 19, 2018 at 10:30:11 PM UTC-7, Sathish VJ wrote: > > I've been asked this question a few times and I haven't been able to find > an answer. Why does go reverse the order of variable declaration: "i int" > vs "int i" > To match PL/I, of course. :-) -ahd- -- You

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Dave Cheney
Sorry, I probably wasn’t clear or didn’t understand that you were asking. I saw that you said GOPATH is not set, it because your code is inside $HOME/go, because of the rules of the default gopath introduced in 1.8, gopath IS actually set. To be extra sure, when I’m playing with go modules I

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread John
I think I missed something in this Dave. Since my directory is already $HOME/go, isn't that what I'd want? Since my path is $HOME/go/...? I found the reference in 1.8 release notes (I would not even have gotten close with a piece of trivia like that!). I did try to move it to another

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread John
Thanks for the link. I did try the following: - Adding a main.go file and doing a go mod init, but that fails. - Just adding a go.mod file with "module main", which allowed compilation, but nothing else worked. - And of course, I added GOPATH back, but that didn't help (and I'm

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread roger peppe
Personally I very much like the fact that name comes before type because the name is the most important thing. The type is a secondary consideration. Limbo (a significant Go predecessor) had the colon there too and I thought I'd find its lack might make Go declarations hard to read but I really

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Dave Cheney
I think because GOPATH is not set it is defaulting to $HOME/go (see Go 1.9 release notes, from memory). Try moving your code to another folder. On Friday, 21 September 2018 05:21:32 UTC+10, John wrote: > > Just started playing with modules recently. Having an issue I don't > understand,

Re: [go-nuts] bufio.Writer's sticky errors & lost data

2018-09-20 Thread Dan Kortschak
I think here, writing your own buffer type would be the most sensible approach. On Wed, 2018-09-19 at 10:14 -0700, John Floren wrote: > What's the right way to handle this? Write our own bufio that lets us > reset  > the error and io.Writer while preserving unwritten data? -- You received this

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Scott Cotton
I think you need to have a main module defined so there must be a go.mod in cwd or upwards in the directory tree, perhaps also with related .go files (not sure). There are some issues such as this one where usage is confusing due to a lack of a main

[go-nuts] go mobile android release?

2018-09-20 Thread Scott Cotton
Howdy Gophers, Noob question for go mobile. I was wondering if anyone knows a good way to conditionally compile for native android apps based on the android version? (build tag android is too general for something I'm working on as is the the range of supported versions in gomobile build).

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-20 Thread Wojciech S. Czarnecki
I moved reply to the separate thread. Subject: "Is "Craftsman's approach" proposal generic enough?" https://groups.google.com/d/msg/golang-nuts/FOGMEFlL04s/kGQ9mKSsCgAJ -- Wojciech S. Czarnecki << ^oo^ >> OHIR-RIPE -- You received this message because you are subscribed to the Google Groups

[go-nuts] Is "Craftsman's approach" proposal generic enough?

2018-09-20 Thread Wojciech S. Czarnecki
[ Subject: Was: [go-nuts] I am not in favor of generics. This is continuation of a thread that went off the rails, now with more appropriate Subject. Previous thread is at: https://groups.google.com/d/msg/golang-nuts/3ia8XrUgqOg/LOsTL8ZlGAAJ ] On Wed, 19 Sep 2018 09:32:39 -0500 Robert Engels

[go-nuts] Using modules with go test ./...

2018-09-20 Thread John
Just started playing with modules recently. Having an issue I don't understand, wondering if anyone has seen it, the few references to the error did not provide anything I saw relevant for what I'm doing. given a directory structure such as: /go/ src/ pkg/ bin/ GOPATH NOT SET

Re: [go-nuts] Re: proposal: generic generics proposal

2018-09-20 Thread alan . fox6
On Thursday, September 20, 2018 at 9:02:36 AM UTC+1, Eric Raymond wrote: > > > Maybe *that's* what the Mysterious Stranger gave me. I couldn't > understand > his description - I think he was speaching Enochian. And a timestamp in > the... > future? On a thumb drive that glows faintly in a

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-20 Thread David Collier-Brown
Not a problem! On Thursday, September 20, 2018 at 11:55:04 AM UTC-4, Michael Jones wrote: > > [Apologies to Dave Cheney, timely pushback for David Collier-Brown] > > David, I disagree and suggest your remark is not well considered. Three > replies, one per sentence. > Not a problem! Indeed,

[go-nuts] Re: bufio.Writer's sticky errors & lost data

2018-09-20 Thread John Floren
On Thursday, September 20, 2018 at 5:50:51 AM UTC-6, Dean Wang wrote: > > >> new connection, new underlying io.Writer, why keep the previous pending > data? > > It's a new connection to the same destination. I want the bytes I wrote to reach that destination, even if we have to negotiate a

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-20 Thread Michael Jones
[Apologies to Dave Cheney, timely pushback for David Collier-Brown] David, I disagree and suggest your remark is not well considered. Three replies, one per sentence. *"Right now, this looks like the third draft of an academic project."* Not to me. This reads like years of thought and discussion

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Andy Balholm
It made sense to Ken and Dennis back when C’s type system was a lot simpler than it is now, anyway. > On Sep 20, 2018, at 7:40 AM, Michael Jones wrote: > > the other answer is: "for c it made sense to ken and dennis, alas, we are not > them" > > On Thu, Sep 20, 2018 at 1:32 AM Eric S.

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Michael Jones
the other answer is: "for c it made sense to ken and dennis, alas, we are not them" On Thu, Sep 20, 2018 at 1:32 AM Eric S. Raymond wrote: > Dan Kortschak : > > To avoid having to have something like this: > > > > http://c-faq.com/decl/spiral.anderson.html > > OK, we now have another candidate

Re: [go-nuts] A utility package to aid in writing end-to-end tests for Go servers

2018-09-20 Thread Marko Ristin-Kaufmann
Hi Agis, Thanks for sharing the package! A couple of more general thoughts re testing: * We (at Parquery) define our server/clients in Swagger spec and then use swagger-to to generate the code (https://github.com/Parquery/swagger-to). Having client and server code automatically generated made

[go-nuts] A utility package to aid in writing end-to-end tests for Go servers

2018-09-20 Thread Agis
Hello. Recently I've wrote a small (hacky) package so that I could easily spin up a Go server I was writing right from within its tests. I often find the need to write some end-to-end tests for a main package (usually some kind of server) and to do that I want to spin the actual binary, so

[go-nuts] Re: I am not in favor of generics.

2018-09-20 Thread David Collier-Brown
Right now, this looks like the third draft of an academic project. It suffers badly by comparison to make(), the existing mechanism. Can we see some more alternatives, please? --dave -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: bufio.Writer's sticky errors & lost data

2018-09-20 Thread Dean Wang
> > > new connection, new underlying io.Writer, why keep the previous pending data? -- 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

Re: [go-nuts] bufio.Writer's sticky errors & lost data

2018-09-20 Thread Peter Waller
On Thu, 20 Sep 2018 at 03:39, John Floren wrote: > What's the right way to handle this? Write our own bufio that lets us > reset the error and io.Writer while preserving unwritten data? > I'm not sure there is "one right way", but one possibility is to push the reliability layer one level down:

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Eric S. Raymond
Dan Kortschak : > To avoid having to have something like this: > > http://c-faq.com/decl/spiral.anderson.html OK, we now have another candidate for the topic of the Mysterious Stranger's thumb drive. A tortuous spiral, drawing the minds of unwary programmers into nighted depths of abyssal

Re: [go-nuts] Re: proposal: generic generics proposal

2018-09-20 Thread Eric S. Raymond
alan.f...@gmail.com : > Not really, TBH, though I'll soon be posting a link to my new treatise: "De > rebus genericis golangi dvo" to the feedback page. > > I thought it might gain more attention if the title were written in Latin . Maybe *that's* what the Mysterious Stranger gave me. I

[go-nuts] Re: why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Volker Dobler
On Thursday, 20 September 2018 07:30:11 UTC+2, Sathish VJ wrote: > > [...] Why does go reverse the order of variable declaration > It doesn't. C and C++, Java, C#, etc are reversed. V. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Agniva De Sarker
Here is your answer - https://tip.golang.org/doc/faq#declarations_backwards On Thursday, 20 September 2018 11:00:11 UTC+5:30, Sathish VJ wrote: > > I've been asked this question a few times and I haven't been able to find > an answer. Why does go reverse the order of variable declaration: "i

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Bakul Shah
On Wed, 19 Sep 2018 22:30:11 -0700 Sathish VJ wrote: > > I've been asked this question a few times and I haven't been able to find > an answer. Why does go reverse the order of variable declaration: "i int" > vs "int i" > > Is there anything in the language design that requires this or was it

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread 'Axel Wagner' via golang-nuts
There is a full blog article with the answer to this question :) https://blog.golang.org/gos-declaration-syntax It's so good, that I actually use it as a reference to people asking me about C's declaration syntax. On Thu, Sep 20, 2018 at 8:03 AM Tristan Colgate wrote: > But every aspect of that

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Tristan Colgate
But every aspect of that still reads unambiguously in a left to right order. Actually understanding C declarations can be extremely challenging. On Thu, 20 Sep 2018, 06:47 Sathish VJ, wrote: > So, you are saying it is only for readability? > > But even in go we can write convoluted functions