Methods – Value Receivers – Go Lang Practical Programming Tutorial p.7

Welcome to part 7 of the Go programming tutorial series. We’ve been talking about structs, and we saw how to create a struct in the previous tutorial, along with accessing values from the struct. Now, we’re curious about how methods might work. While Go doesn’t have classes, it does have methods. The methods are not defined within the struct, however. Instead, they’re associated with the struct. Here, you can either let these methods just access data via working as a copy of the struct, or you can actually point through and modify the object. Methods that just access values are called value receivers and methods that can modify information are pointer receivers.

Text tutorials and sample code:


B100DYH311 says:

Stay fluffy sentdex (>^_____^<)

Locationary says:

You should spend more time explaining the code instead of rushing through it for example you didn’t explain why you would write func(c car) kmh() and not func kmh()(c car).
I think the main problem is with your videos you assume people have a python background and already know much of the layout of the code.

Stjepan Brkić says:

“its so simple, it doesn’t even exist” ahhh :)

Keith Lashley says:

Hello Sendex I have just started Golang. I am working on getting gomobile connected to my android SDK.. I haven’t found a lot of video tutorials on gomobile. Do you think you could do one similar to your Kivy tutorials in the near future? I like your content it’s very good.

Igor Gomonov says:

Thank you for your tutorials. They are so clearly. If you have more advanced golang cources in any of educational platforms (Udemy,Courcera etc) I want to get them! Keep do such a great lessons and tutorials.

İhsan Cemil Çiçek says:

First time I heard that value receiver, pointer receiver. They basicly same anyway 😀

Write a comment


Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours