Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created January 9, 2022 14:20
Show Gist options
  • Save percybolmer/19f33fad4bcfefb70458def73b91a395 to your computer and use it in GitHub Desktop.
Save percybolmer/19f33fad4bcfefb70458def73b91a395 to your computer and use it in GitHub Desktop.
// We define the Type parameter V, which is a int, int32 or float32
// We also say that function parameter a and b has the data type of V
// We then make the function return V
func Subtract[V int | int32 | float32 ](a, b V) V {
return a - b
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment