This was the best explanation of go generics I've found, subscribed!
@leetwareltd2 жыл бұрын
Thanks mate, appreciate the kind words
@happy..190729 күн бұрын
Very well explained, thanks for creating this video. 👍
@L0wPressure11 ай бұрын
I was confused at first to see that TSM is doing golang videos nowadays... Quite a nice video with clear examples. Thanks :)
@_w62_ Жыл бұрын
This is so far the best video on explaining GENERICS. 👍x10000
@fabrizziorosales987910 ай бұрын
The best video that explains generics in go, Thanks :)
@leetwareltd10 ай бұрын
Thanks mate, means a lot to hear you say that 😊
@rw_panic0_011 ай бұрын
thanks, I really like the Currency example, shows what Go generics are capable of!
@computeering4 ай бұрын
Broda u r just awesome
@a_maxed_out_handle_of_30_chars8 ай бұрын
thank you :)
@abhinandanbhattacharya11452 жыл бұрын
Great tutorial, thank you!
@douglaspetrinbertini Жыл бұрын
Thanks, very good content here!
@dean-channel Жыл бұрын
Thanks, good tutorial!
@ashutoshsinha5345 Жыл бұрын
Its the best so far for Generics
@mikolajsemeniuk8574 Жыл бұрын
Nice video!
@berkansivrikaya9055 Жыл бұрын
I don't get the last example. What is difference between `func PrintBalance[T Currency](b T )` with the function `func PrintBalance(b Currency)`?
@leetwareltd Жыл бұрын
Great question - my understanding is that you can't use type constraints (in this case Currency) as a type in a normal function - only in a generic function. The reason has to do with how the compiler works, non-generic functions always compile once to handle that function. But a generic function will compile multiple times for each type that it handles. The constraint `Currency` can't be used as a type to compile into a function which works for all implementations of `Currency` - so we need to use a generic function. At least this is how I remember it working in go 1.18 - it's been a while since I looked this deeply at it 😅
@manavshah53954 ай бұрын
Great question. I still don't understand this bit.