To celebrate the first anniversary of generics in Go, let’s build something practical and useful: a generic Set type, and add some neat methods to it. Ready for fun?
All tagged golang
To celebrate the first anniversary of generics in Go, let’s build something practical and useful: a generic Set type, and add some neat methods to it. Ready for fun?
In Part 2 of a series about writing packages, not programs, we see how to test a package that prints to the terminal, and use the result to build our “hello, world” CLI tool.
Go has a great standard library. What if we think about our work not merely as building one-off programs, but instead contributing packages to the universal Go library?
Did you know that Go lets us provide executable code examples as part of our documentation? It’s pretty neat. Let’s take a tour of this useful feature and see how it works.
Wouldn't it be nice if we could run test scripts directly from the command line? The standalone testscript tool does exactly that. Let’s see how to use it to create simple, self-contained issue repros.
Continuing our series on the testscript package, we look at some advanced techniques in test scripts such as conditions, concurrency, and managing environment variables.
The testscript package gives us an easy way to test the behaviour of a Go CLI tool, by executing it as an independent binary. Let’s see how.
If you’re a BIT student, are you ready for your green belt test? If you’re studying independently, check your Go skills and see whether you’d pass this demanding certification.
Visual Studio Code is the most popular Go editor, and no wonder: it’s the Batman’s utility belt of editors. Let’s cape up and take a tour of VS Code’s Go superpowers.
The internet is very big, and a vast ocean of network resources lies undiscovered before us. Let's dip a hook into that ocean now and see what we can catch with an API client in Go.
The Unix shell is pure wizardry. Why shouldn’t it be as easy to write systems programs in Go as it is in the shell? The script library is the secret spell-book that makes this possible.
“Clean code” is so over: all the cool kids are switching to CRISP code. I’ll show you how to achieve it in five catchy, T-shirt-friendly slogans.
The new io/fs package in Go 1.16+ gives us a powerful new way of working with filesystems. Walk with me, then, as we take a tour of the new fs.FS interface and see what it can do.
The defer keyword in Go can seem mysterious at first: why do we need it? How do we use it? Let’s explore some common patterns that use defer to build robust, efficient programs by preventing resource leaks.
What is test-driven development (TDD), and how does it work in Go? This friendly tutorial shows you how to build a new Go package from scratch, test-first, step by step. All you need is Go!
Do you find writing tests hard? Especially writing them first? Don’t let smug Internet thought leaders tell you what to do. Instead, embrace the new software paradigm that lets you just do whatever comes easiest.
Jon Bodner’s ‘Learning Go’ is simply the best single-volume Go book for experienced developers, and I don’t say that lightly. This book will give you a better, wider, deeper, and certainly more up-to-date knowledge of Go than any other.
Learning is hard. How do you plan, study, organise your time, and build the right habits? Master teacher John Arundel gives ten helpful hints for students who want to really learn Go.
Which is better, Python or Go? Which language should you learn today, and why? How do the two compare in performance, ease of learning, scalability, and rapid prototyping? Let's find out, in this friendly and accessible overview of Python and Go for beginners.
Optimizing Golang code for performance is almost certainly a waste of your time, for several reasons: performance doesn’t matter, Go is fast, and readability is more important than speed. You can buy a faster computer, but you can’t buy a faster brain.