Hello, I need some help understanding the code here:
https://github.com/iamshaunjp/golang-tutorials/blob/lesson-22/main.go
Its from this tutorial on interfaces https://www.youtube.com/watch?v=lbW-KVdIXaY
// square methods
func (s square) area() float64 {
return s.length * s.length
}
Help me understand: So this is an anonymous function that takes parameter "s," which is of type struct named square and returns float64? What is the relevance of area() ? What is this doing in the function syntax? Are area() and circumf() part of the math package, because I don't see what they do or how it work in this code?
I don't see where the square methods and circle methods are being called. Really confused
Is shapes a slice of dictionaries?
All course files for the Net Ninja Go tutorial series. - golang-tutorials/main.go at lesson-22 · iamshaunjp/golang-tutorials
In this final Golang tutorial of the series, we'll learn about interfaces!
🐱👤 View this course in full without ads on Net Ninja Pro:
https://netninja.dev/p/learn-go-golang
🐱💻 Course Files:
🐱👤 JOIN THE YOUTUBE NET NINJA GANG -
https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg/join
🐱...