Hacker News new | past | comments | ask | show | jobs | submit login
Learn Go with Tests (gitbook.io)
352 points by Lantt on April 26, 2022 | hide | past | favorite | 28 comments



If you like this you will like the concept of learning with koans or katas. The "rustlings" intro to rust is in such format. Most use test runners but you usually edit the code not the test.

https://github.com/rust-lang/rustlings

https://github.com/gamontal/awesome-katas

https://github.com/ahmdrefat/awesome-koans/blob/master/koans...


This book is hugely different from the katas or koans of the early 2000's though. It teaches you with full program structures that you would encounter in the real world. You come out of the book knowing best practices for building real applications.


I once found out about that technique for Scala, which actually has an operator / language construct for "fill in the blanks here"; I believe if called it just throws a NotImplementedException or something like that.


Rustlings is a great way to get a feel for what you learn in the Rust Book.


This is one of the best resources for starting with Go! It’s very practical and teaches a lot of important concepts in an easy to understand way. Cannot recommend this enough! If you read the book and learned something new consider sponsoring the author as a ‘thank you’!


Thanks for the resource. I have been using Go By Example[1] to learn and your gitbook is a great complement to that.

[1] https://gobyexample.com/


The official Go tour (https://go.dev/tour/) is also a good resource IMHO, especially for people already experienced with other languages, because it points out the key differences.


Great resource!

I agree TDD is a good way to learn a new language.

One of my favorite books Exercises for Programmers (https://www.programmingbooks.dev/extra/#exercises-for-progra...) promotes this approach as well.


Another great resource that influenced my thinking on TDD even outside Python is the "testing goat" book (aka "Test-Driven Development with Python" by Harry Percival) https://www.obeythetestinggoat.com/


I think 'Learn <Programing language> with tests' is good way for someone programing language newer to start.


Read and typed along with an early edition of this a few years back and it has continued to be one of my favorite technical tutorials of all time, far surpassing lots of other golang material that I've paid money for.


I went straight to the code about concurrency[1] and I really liked it, I learned so much just by reading a couple of lines of code and tests.

[1]: https://github.com/quii/learn-go-with-tests/tree/main/concur...


Go is among the lowest barrier-to-entry programming languages but most entry-level tutorials don't even get into testing, So a test focused entry-level Go tutorial is indeed a fresh take and an useful one.

Congratulations to the author & contributors.


Thanks for the resource! I'm having a lot of fun exploring your notebook. I'm not entirely sure why I decided Go would be the net programming language I learnt, but I'm glad I did that!


This is my favorite learning resource for Golang. Thanks for writing it!


After doing the go tour, this was my learning resource that solidified all the concepts for me. Learning how to test and make tests easy in Go was so beneficial. Most resources only teach the language constructs with maybe a brief mention of testing package


I decided to learn and use Go for my recent job hunt, and this site was just the best. I used the structure of the code in the "build an application" section in every take home coding challenge I wrote.


Brilliant resource. I learned a lot from real practical examples (compared to the bluebook "The Go programming language"). And I started writing tests religiously after reading it.


As someone who has just started learning Go I'll definitely take this on. Kudos for writing a book, definitely something to be proud of!


I am just using this in the last few days to learn go to change stack, really the best form of tutorial I ever used in my whole cs life.


This looks like a good structured way to learn Go. Is there a way to turn the lights off on these GitBooks?


Hi, author here.

The project is open-source (https://github.com/quii/learn-go-with-tests) so there's a few options available to you.

In releases, you'll find PDFs and epubs, I'm pretty sure most epub readers will let you use a dark mode. Or you can just read the markdown files on GitHub, which also supports it.


Thanks, I was looking for this but couldn't see it for some reason.


> Is there a way to turn the lights off on these GitBooks

Dark Reader: https://darkreader.org/


Great resource, I am working my way through it as we speak.


I like a lot the mocking chapter. Very well done.


Is there something like this for C/C++?


nice site! Kudos to the developer!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: