Module 3: Object-Orientation in Go, Topic 1.3: Support for Classes. Now, in a normal object directed language, it's a class is defined, it's data associated with some kind of methods. And usually, you can associate lots of different data, you can roll up lots of different variables. Maybe an anti-float, whatever type of data you can put a lot of it, as much as you want together. And then associate that with any number of methods, asnd you can do the same thing in go. Of course, you're going to use a receiver type, just like we talked about, you don't have classes, you have receiver types. But you can just use a type that has lots of data in it. So, before we're using examples where the type was just an int myant, right. It was just an int, one piece of data. But it's very common to use a struct as a receiver type, a struct of some kind. So structs basically allow you to compose all kinds of different data fields. So in this case, my point struct, I'm just composing two numbers, an x and a y, both floats. So two floating point numbers, they're composed into one struct. But remember, with a struct you can compose an arbitrary amount of information, you can put together. So it's very common to see a receiver type be a struct of some kind with lots of different data. It's a traditional feature of classes, people just roll lots of different data together. Now, the structs with methods, you could take a struct and define it as a type, like we just did with that point type. And then you can associate methods with that type. And then you get what you would normally think of as a class in another language. You get the struct with lots of different data, associate it with as many different methods as you want to associate it with struct. So, we got an example of that right here, we're using the point that I defined just in the last slide. So, this point, I want to make a function called DistToOrigin, and I've defined it right there. Notice that to the left of the name of the function DistToOrigin, I pass it a point, p Point, right? When I say I pass it, it's an implicit pass, right. So it doesn't have any explicit arguments, but its receiver type is a Point called p, and that will be implicitly passed to DistToOrig. And then if you look at the function, the insides of it, the internals, it's just doing the Pythagorean theorem, right. It's squaring the x, squaring the y, adding together, then it returns the square root. So it just does Pythagorean theorem nothing sophisticated. Then in my main, I can make a point p1 is three comma four and then I can just call p1.DistToOrigin. And that p1 together with its x and y coordinates will be implicitly passed to dist to origin. Dist to origin will then do Pythagorean theorem and return the distance which is five in this case, thanks.