14 ms·
Go by Example
- vkat 13y agoThanks, I am going to use this for my go experiments.
- deleted 13y ago[deleted]
- tboyd47 13y agoHey, nice site. FYI I can't copy and paste from the examples on the site without also bringing in the text on the left too.
- cupcake-unicorn 13y agoAre there any plans to make this into something more interactive, like http://nodeschool.io/ http://nodeschool.io/? Alternatively, do any of the interactive "Learn Coding" sites out there feature Go? I can't think of any.
- steveklabnik 13y agoThe tour does this: http://tour.golang.org/ http://tour.golang.org/
- aaronbrethorst 13y agoLove it, bookmarked. I've been hoping for something like this for a while. One of the most frustrating things for me about trying to pick up Go is a lack of 'guaranteed quality' examples of different basic operations, especially code that adheres to the latest spec.
- nadinengland 13y agoAnother nice introduction is the Go Playground's Tour (http://tour.golang.org/#1 http://tour.golang.org/#1).
- sergiotapia 13y agoIt's Friday gents! No excuse to set aside Saturday and Sunday, you can easily go through these examples in two days and grok it. Go is that _slim_, and that's good! Guaranteed you'll find use for Go in one system or the other when you want easy deployment, fast development time and extreme speeds. :) (Disclaimer: I love Go and I hope it goes mainstream in a big way in 5 years)
- binarycrusader 13y agoI've learned enough 'Go' to write a small 3D framework in OpenGL, and after doing so, I have no desire to go back for most of my projects. Making go-routines map to OS-level threads is a pain. And as much as I hate to trot out this old chestnut, the lack of generics is also a real pain. I've gotten too used to having generic containers to go back, and the various hacks available just aren't worth it. I still can't believe Go doesn't have some of the "basic" data types that older languages do such as Python's set() objects and the various operators. That said, if was writing a small command-line utility for text manipulation or something else similar in scale that doesn't involve dealing with POSIX threading, I'd probably use it instead of Python, C, or C++.
- TylerE 13y agoYou might like nimrod. Similar performance characteristics (or better) than Go, with Generics and meta-programming. Library situation is a little iffy, but there are full SDL and OpenGL bindings.
- FG_Regulus 13y ago> Similar performance characteristics (or better) than Go. Nope. It's without a doubt 100% better. The GC is brilliant and realtime with deterministic properties. The community has outperformed C++ in ray tracers and games, Ada in text manipulation, etc. It's absolutely freaking blazing since it compiles to really tight C and takes advantage of the 50 years of C compiler research & design. > Library situation is a little iffy. Libraries are hardly iffy. Any C code be called, and most c++ code can be called very, very easily and with little boilerplate. The standard library has a huge pure section, and for almost everything else it has dozens of bindings to C libs. And there are plenty of existing libraries in the babel library manager, such as SFML.
- donbronson 13y agoThe documentation format is a revolution of simplicity and comprehension. I can see this list format (and content) working for any/all languages.
- L8D 13y agoI'm in the process of making a clone of the site for node.js [here](https://github.com/L8D/nodebyexample https://github.com/L8D/nodebyexample)
- donbronson 13y agoThrows a 404. Is it a public repo?
- L8D 13y agoYeah, I trashed pretty quickly because I realized I didn't have time to work on it, nor did I have the creativity to write good examples. It would have better suited to be about JavaScript rather than Node, and there are already plenty of better ways to learn good JavaScript on the internet. I might do 'Haskell by Example' which would be really fun, if I ever have time for it.
- deleted 13y ago[deleted]
- captn3m0 13y agoPocco[1]/Docco[2] is a good way to do this. [1]: http://fitzgen.github.io/pocco/ http://fitzgen.github.io/pocco/ [2]: http://jashkenas.github.io/docco/ http://jashkenas.github.io/docco/
- knotty66 13y agoNice and clean. I like it. Maybe it would be nice to have comments with up/down votability ala Stackoverflow.
- dclara 13y agoSuch a nice UI. We all like fast food! - Eggs should not be washed.
- tokenizerrr 13y agoThis documentation is great, but one thing I tend to miss with examples like these is how to structure a project, deal with packages, etc.
- stokes3452 13y agoAgreed, the community does seem pretty loose on project structure--which is interesting since the language takes such strong stances on code structure. Since your folder structure is also your package structure, with rmux[1] I tried to separate the project into dependencies, and use a package for each one. I like to also limit files to one class--but if you read through the default package files, the creators seems to go both ways. One interesting thing that isn't mentioned often is how to handle the equivalent of #ifdef, through +build flags. This isn't the best solution, since all functions and their arguments are evaluated (even empty functions), but it does allow for the use of constants to wrap around cpu-wasteful debug-only areas/ [1]: https://github.com/forcedotcom/rmux https://github.com/forcedotcom/rmux
- pearkes 13y agoGitHub is your friend here. Here is a search for Go repositories with > 100 stars.[1] Every project will look different (the really big ones might be more complex then you need) but as you get deeper into the results you can find some great stuff. [1]: https://github.com/search?l=go&q=stars%3A%3E100&s=stars&type=Repositories https://github.com/search?l=go&q=stars%3A%3E100&s=stars&type...
- tokenizerrr 13y agoThat's a great idea, I hadn't thought of that.
- motter 13y ago"How to Write Go Code" shows you this, and is a good read: http://golang.org/doc/code.html http://golang.org/doc/code.html
- dclara 13y ago
- namelezz 13y agoGolang is good language. Cannot wait until it's generic.
- deleted 13y ago[deleted]
- nickik 13y agoI am not personally interested in Go but I care about CSP. I will defently check out some of these CSP things and maybe try to recreate them in Clojure core.async.
- kirkbackus 13y agoIt's about time! Go doesn't really have a good community or really practical examples. Glad to see someone took the time to put this together.
- insertnickname 13y ago> Go doesn't really have a good community What about freenode/#go-nuts? Seems like a very nice channel to me.
- holycow19 13y agoVery Cool - thanks
- deleted 13y ago[deleted]