Sign up
Forgot password?
FAQ: Login

Arundel John. Know Go Generics Programming with type parameters

  • pdf file
  • size 3,38 MB
Arundel John. Know Go Generics Programming with type parameters
John Arundel April 18, 2022, 142 p.
This book is about generics in Go. We’ll talk about exactly what that means in more detail later on, but, briefly, it’s about defining (and using) generic functions and generic types. First, what’s a generic function? It’s one that doesn’t specify the types of all its parameters in advance. Instead, some types are represented by placeholders, called type parameters. Generic types work the same way. For example, we might want to define a slice of elements of some unspecified type or a struct with some field of a type that will be known later. Like many things in programming, generics sounds complicated at first, but once you get your head around it, it’s actually quite straightforward. In this book, we’ll work together through the steps necessary to understand what generic functions and types are, why they’re useful, how they work in Go, and what fun and interesting things we can do with them.
  • Download option was blocked by copyright claim.
Up