Go by Example (@gobyexample) profile picture

Your hands-on guide to Go.

Joined September 2012
Added initial support for linking to Go Playground. Click the gopher to try it out: gobyexample.com/hello-world. Thanks @jaywgraves /cc @golang
1
3
Replying to @simeonwillbanks
@simeonwillbanks Ordering here is non-determinisitc because of concurrency. Try a Sleep to force interleaving?: gist.github.com/mmcgrana/8e3…
1
Replying to @fabmilo
@fabmilo glad you've enjoyed it - thanks!
Replying to @krarick
@krarick Yeah good point. I've made an initial update of these examples towards named formats for parsing. Thanks for the tip!
We're having another issue with site and are working to resolve it now.
We had an ~11m outage of the gobyexample.com site - sorry about the inconvenience.
@myitzhaksamuel I'm not familiar with any tutorials of that type yet. You could try Google-translating through github.com/astaxie/build-web…
Basic of reading files in #golang: gobyexample.com/reading-file…. Too much to cover in one page but this should get you started.
1
@ryandotsmith I'm not sure - what do you think? The format currently requires <= 58 chars and lots of printing...
2
Time formatting & parsing in #golang: gobyexample.com/time-formatt…. I was really confused by these until I understood the example-based approach.
JSON in #golang: gobyexample.com/json. This tripped me up when I was getting started, especially the type assertions for using ad-hoc data.
3
1
Errors in #golang: gobyexample.com/errors. I love Go's use of return values for errors and natural support for data-conveying errors.
1
Replying to @RalphCorderoy
@RalphCorderoy Yeah I agree - I've fixed this in the site - thanks!
@jogbert This use of cat+grep always seemed to me aligned with the philosophy "do one thing and do it well", but I often get flack for it (:
1
`cat examples.txt | grep -v "#" | wc -l` => 60. Building into some network client/server examples soon: github.com/mmcgrana/gobyexam….
1
#golang has excellent support for string formatting in the printf tradition: gobyexample.com/string-forma….
1
1
Basic (pseudo)random number generation mechanics in #golang: gobyexample.com/random-numbe….