[go-nuts] [ANN] kurly - A replacement for the widely popular curl tool, written in Golang

2017-05-01 Thread David Peacock
Partly inspired by Tony Arcieri's "It's time for a memory safety
intervention" blog post, partly just due to feeling it's the right time,
and partly because why not, my friend Al S-M and I have kicked off a
project to replace curl's HTTP(S) functionality with a new tool written in
Golang.

We've tackled a fair chunk of HTTP(S) features already, and feel it's time
for version 1.0.0 to be released to the internet.

Bug reports, pull requests, etc, all welcome.

http://davidjpeacock.ca/post/announcing-kurly/

https://github.com/davidjpeacock/kurly

David Peacock

-- 
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/optout.


Re: [go-nuts] Re: Semicolons in Go

2017-04-24 Thread David Peacock
Please don't feed this troll.

On Mon, Apr 24, 2017 at 10:42 AM,  wrote:

> One of the things that I learned early in life is to recognize B.S. when I
> see it. My B.S. flag went up first when I read where someone claimed that
> "artifacts" are bad and detract from the readability of code. A compact and
> well-defined artifact, like the semicolon, makes code *more* readable
> because the programmer's intent is crystal clear, whereas removing them
> leaves one guessing exactly where a line ends. The rules are considerably
> more complex - not to mention vary across languages, than the simple "it
> ends at the semicolon" rule.
>
> Now I read that the programmer's preference is irrelevant (I hope that we
> can agree that the programming community consists of individual
> programmers!). Well, that flag just shot up again. There's no reason that
> an individual's preference can't be respected when he's editing code, even
> if way that the code is stored on disk is the same. That's why I
> exclusively use TAB characters for indentation - some people prefer to see
> 2 spaces per level of structure, I prefer 3 spaces and someone at my
> company prefers 8. We get to see what we prefer without requiring any
> changes to the code itself.
>
> So, here's my current thinking about long lines/continuation lines, take
> it for what it's worth. There should be no such thing in a language. A long
> line should just be a long line, without limit, in the source file. After
> all, it's not the compiler that wants to split long lines so that they are
> more readable - it's the programmer when using a text editor or code
> viewer. Think how much simpler a compiler would be if it could just assume
> that a simple (i.e. non-compound) statement always exists on a single line!
> It's the editor that should display a single simple statement on multiple
> lines on the screen. In fact, the editor could provide visual cues that a
> single statement is being displayed on multiple lines on the screen, such
> as a light gray background color, underlining, box around it, whatever. The
> point is that the individual programmer's personal preference would be used
> without affecting the saved format of the code.
>
> For that to work well, the editor would probably have to understand the
> syntax of a statement so that the line splitting will result in something
> that the programmer finds readable. I don't know if a current editor that
> can do that. But line splitting is something that the compiler should *not*
> have to deal with. After all, it's the programmer using an editor that
> cares about making long lines readable, not the compiler.
>
> --
> 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/optout.
>

-- 
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/optout.


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 suddenly require Go 1.7. I'm trying to figure out which package
> that is, and the output of "go get" doesn't seem to help much.
>
> I develop on a Mac with OS X Sierra, so I sadly cannot really use Go 1.6
> to troubleshoot in my local environment (the failing Go 1.6 build is
> running in Travis.) What I have tried is cleaning out my GOPATH and running
> the same "go get" command. Since I am running Go 1.7, it succeeds of course.
>

Have you tried `go get -u` to attempt an automatic update of the imports?
Is that available in 1.6?

-- 
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/optout.


Re: [go-nuts] Teaching Elementary/Middle School Kids?

2017-04-11 Thread David Peacock
Ah, the mistake was my phrasing.

Teaching Go to anyone is not off-topic at all on this Go mailing list. :-)
 I meant my advice surrounding CodeClub was off-topic since it relates to
other languages. :-)

My apologies for the misunderstanding.

On Tue, Apr 11, 2017 at 1:26 PM, Bala Natarajan <
bala.natarajan.p...@gmail.com> wrote:

> I did not realize that this was off-topic. My mistake.
>
> Thanks David and Konstantin for the suggestions
>
> Thanks
>
>
> On Tuesday, April 11, 2017 at 6:29:21 AM UTC-7, David Peacock wrote:
>>
>> This is firmly off-topic for this list, but I too am interested in this
>> area, having recently formed a chapter of CodeClub in my small town.
>>
>> I'd suggest you start at https://www.codeclubworld.org/
>>
>> I'm happy to speak with you off-list.
>>
>> Good luck!
>>
>> Cheers,
>> David
>>
>> On Tue, Apr 11, 2017 at 8:24 AM, Bala Natarajan <bala.nata...@gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> I am trying to put together material to teach go to elementary/middle
>>> school kids. Does anyone have public material that I could use as a guide
>>> to prepare this material? Any suggestions on small projects that I could
>>> give these kids? Thanks for your suggestions.
>>>
>>> Thanks
>>> bala
>>>
>>> --
>>> 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...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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/optout.
>

-- 
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/optout.


Re: [go-nuts] Teaching Elementary/Middle School Kids?

2017-04-11 Thread David Peacock
This is firmly off-topic for this list, but I too am interested in this
area, having recently formed a chapter of CodeClub in my small town.

I'd suggest you start at https://www.codeclubworld.org/

I'm happy to speak with you off-list.

Good luck!

Cheers,
David

On Tue, Apr 11, 2017 at 8:24 AM, Bala Natarajan <
bala.natarajan.p...@gmail.com> wrote:

> Hi
>
> I am trying to put together material to teach go to elementary/middle
> school kids. Does anyone have public material that I could use as a guide
> to prepare this material? Any suggestions on small projects that I could
> give these kids? Thanks for your suggestions.
>
> Thanks
> bala
>
> --
> 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/optout.
>

-- 
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/optout.


Re: [go-nuts] Trouble with HTTP PUT, and 100-continue

2017-04-09 Thread David Peacock
Thanks Brad; I'll take a look and see how to plug this in.

On Sun, Apr 9, 2017 at 11:39 AM, Brad Fitzpatrick <bradf...@golang.org>
wrote:

> See https://golang.org/pkg/net/http/#Transport.ExpectContinueTimeout
>
> The Go http package deals with 100 continue automatically.
>
> On Sat, Apr 8, 2017 at 3:24 PM, David Peacock <david.j.peac...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I'm having difficulty implementing file upload using
>> http.NewRequest("PUT").  As shown in my use case below, I'm attempting to
>> open a PUT connection to a remote server, and hand over a binary file.
>>
>> What I am expecting after my client headers are sent is an HTTP
>> 100-continue response, but instead I'm receiving back a 200 OK.
>>
>> https://play.golang.org/p/i1cgVH5JZd
>>
>> Am I going about this the right way?  Do I have some fundamental mistakes
>> with what I'm doing?
>>
>> Any pointers would be appreciated please.
>>
>> Thank you,
>> David
>>
>>
>> --
>> 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/optout.
>>
>
>

-- 
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/optout.


[go-nuts] Trouble with HTTP PUT, and 100-continue

2017-04-08 Thread David Peacock
Hi all,

I'm having difficulty implementing file upload using
http.NewRequest("PUT").  As shown in my use case below, I'm attempting to
open a PUT connection to a remote server, and hand over a binary file.

What I am expecting after my client headers are sent is an HTTP
100-continue response, but instead I'm receiving back a 200 OK.

https://play.golang.org/p/i1cgVH5JZd

Am I going about this the right way?  Do I have some fundamental mistakes
with what I'm doing?

Any pointers would be appreciated please.

Thank you,
David

-- 
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/optout.


Re: [go-nuts] [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread David Peacock
On Sat, Mar 11, 2017 at 5:14 PM, leonsal  wrote:

> G3N is an OpenGL 3D Game Engine written in Go: https://github.com/g3n/
> engine
> Try out the game engine demo at: https://github.com/g3n/g3nd
>
> This is very welcome indeed.  Massive kudos!

Thank you!

David 

-- 
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/optout.


Re: [go-nuts] sort.Slice arguments

2017-03-08 Thread David Peacock
On Wed, Mar 8, 2017 at 10:01 AM, Val  wrote:

> Sorry for not elaborating in the first place (I was trying to make the
> point very concise).
>

Thank you for detailing further! :-)

> The bug in my code is that the two arguments I pass to sort.Slice are
> inconsistent : the portion to be sorted is a reslicing from itinerary,
> while the "less" closure indexes items of the whole itinerary.
>
> I brought up the "go vet" idea because I feel that whenever someone will
> do some reslicing directly in the first argument,
> - either the result will be "broken" like mine,
> - or the code in the less function will have to refer to the same
> (unnamed) resliced portion, which is imo convoluted : fix 1
>  or fix 2
>  .
>
> The most readable alternative I can think of while still using sort.Slice
> is to reslice in a new variable prior to sorting : fix 3
>  .
>

Personally, I would favor fix 3 in this context.

Cheers,
David

-- 
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/optout.


Re: [go-nuts] sort.Slice arguments

2017-03-08 Thread David Peacock
On Wed, Mar 8, 2017 at 8:32 AM, Valentin Deleplace 
wrote:

> I did explain the expected result : "and I want to visit other cities in
> alphabetical order"
>

Jan is correct; the characterization of a problem hinges on accurately
describing what you expect and what happened instead.  Terms such as
"broken" and "does not work" are best avoided because others don't know
what your definitions are for these in the given context. :-)

That being said, your alphabetical order is returned as you intend if you
adjust line 17 thusly:

sort.Slice(itinerary[:], func(i, j int) bool {

Cheers,
David


>
> Le 8 mars 2017 2:16 PM, "Jan Mercl" <0xj...@gmail.com> a écrit :
>
>> On Wed, Mar 8, 2017 at 2:10 PM Val  wrote:
>>
>> > What do you think?
>>
>> You should explain what you've expected to get instead of what you've
>> got. Without that, I for one, cannot figure out what you see as broken and
>> I have no idea why do you think it's not a good idea to sort a slice of a
>> slice. After all, it's just a slice as any other.
>>
>> --
>>
>> -j
>>
> --
> 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/optout.
>

-- 
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/optout.