To support this, you’ll write a function that declares type parameters in
addition to its ordinary function parameters. These type parameters make the
function generic, enabling it to work with arguments of different types. You’ll
call the function with type arguments and ordinary function arguments.
If you want to change selection, open document below and click on "Move attachment"
Tutorial: Getting started with generics - The Go Programming Languageher type, that single function will need a way to declare what types it supports. Calling code, on the other hand, will need a way to specify whether it is calling with an integer or float map. <span>To support this, you’ll write a function that declares type parameters in addition to its ordinary function parameters. These type parameters make the function generic, enabling it to work with arguments of different types. You’ll call the function with type arguments and ordinary function arguments. Each type parameter has a type constraint that acts as a kind of meta-type for the type parameter. Each type constraint specifies the permissible type arguments that calling code can us Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details