Golang Tutorial #21 - Struct Methods

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024
  • This golang tutorial covers structs and struct methods. These are just like regular methods from object oriented programming but act on structs. Methods are like functions that can be called on a specific type, in this case they will be called on our created structs.
    🎙 Subscribe to my second channel for weekly podcasts! / @timeoutwithtim
    ◾◾◾◾◾
    💻 Enroll in The Fundamentals of Programming w/ Python
    tech-with-tim....
    📸 Instagram: / tech_with_tim
    🌎 Website techwithtim.net
    📱 Twitter: / techwithtimm
    ⭐ Discord: / discord
    📝 LinkedIn: / tim-ruscica-82631b179
    📂 GitHub: github.com/tec...
    🔊 Podcast: anchor.fm/tech...
    💵 One-Time Donations: www.paypal.com...
    💰 Patreon: / techwithtim
    ◾◾◾◾◾◾
    ⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
    ⭐ Tags ⭐
    - Tech With Tim
    - Golang Tutorial
    - Structs Golang
    - Methods Golang
    - Go Methods
    - Go Object Oriented Programming
    - Methods in Golang
    ⭐ Hashtags ⭐
    #GO #Golang

Комментарии • 60

  • @MulyadiPermadi-h7l
    @MulyadiPermadi-h7l Месяц назад

    3 minutes in and im already understand how it works. Straight to the point no bullshit. Thanks!

  • @dmns
    @dmns 3 года назад +13

    This is hands down the best example I could find on methods (even compared to paid courses). Thanks!

  • @armoredgemini
    @armoredgemini 8 месяцев назад +2

    Great description of methods. It seems like a good rule of thumb would be if your method name starts with ‘set’, then use a pointer. However, I have also read that you would use a pointer for large data structures, as using a value receiver creates a copy of the data being passed to the method. The pointer receiver would prevent the method from using system resources unnecessarily. Am I understanding that correctly?

  • @michaelbonnet590
    @michaelbonnet590 Год назад

    very much appreciate that these videos explain things as if Go were all that had ever existed - that is, not explained via comparisons to other langauges and their concepts.

  • @rethanon
    @rethanon 4 года назад +20

    I'm finding Go nothing like Python and while I can follow through each episode and understand the concepts, the syntax is so much more complex I can't get any of it to stick in my head. Hoping it will just one day fall into place!

    • @udhavmohata9281
      @udhavmohata9281 3 года назад +1

      Go is similar to C and C++ not python.

    • @artrodin3697
      @artrodin3697 2 года назад +2

      @Nicolás Gómez Aragón being a python engineer, i find a golang readability statement questionable

    • @sheebek
      @sheebek 2 года назад +1

      some parts looks like php concept

  • @dandavis8500
    @dandavis8500 2 года назад

    Using your videos to supplement what is unclear in the book I'm reading. Got lost on methods and totally got found with your video. Thanks a million!!

  • @brutalbutler
    @brutalbutler 4 года назад +8

    by the way they are called function receivers, as specified in the go docs

  • @allenjames4752
    @allenjames4752 4 года назад +3

    Really need a golang API tutorial pleaseee...

  • @zahidulislam2068
    @zahidulislam2068 2 года назад +1

    Tim, you have done an excellent job on this complex topic. Thanks a lot

  • @gnul
    @gnul 3 года назад +5

    Let's go let's go!
    That language looks pretty awesome. :)
    Will probably use it in conjunction or addition with C#.

  • @danchisholm1
    @danchisholm1 3 дня назад

    very good video. explained much better than most

  • @gregherbster8703
    @gregherbster8703 7 месяцев назад

    Just what I needed. Ty.

  • @GuitarreroDaniel
    @GuitarreroDaniel 4 года назад +3

    This was an amazing tutorial man, thank you very much!

  • @bilza2023
    @bilza2023 Год назад

    such an attention to detail at this age

  • @blain20_
    @blain20_ 3 года назад

    Great video series. I recommend being precise when saying parentheses, braces, and brackets. 👍

  • @techcode_man
    @techcode_man Год назад

    Excellent tutorial Tim! Thank you!

  • @MaximRovinsky
    @MaximRovinsky 4 года назад +2

    Thank you for this great tutorial. Really cool

  • @merohan619
    @merohan619 Год назад

    thanks for clearing the topic

  • @iossipmiljak6770
    @iossipmiljak6770 4 года назад +5

    Can not wait for channels and go routines :D
    Do you have any plans of doing some tutorial on web programming with Go (cause of very powerful standard library), cause personally I still struggle with understanding Go documentation on those packages (whole node.js environment is much more understandable).

    • @salmaan6094
      @salmaan6094 3 года назад +2

      bro, I highly recommend seeing videos by Todd McLeod, he has a really nice way of explaining things from scratch. And after watch Tim's videos, your concepts will be crystal clear!

  • @whatzittoya4639
    @whatzittoya4639 2 года назад

    outstandingly well explained

  • @qolbinurwandi
    @qolbinurwandi 2 года назад

    Very insightful than udemy. Thanks tim!

  • @asmr_codster
    @asmr_codster 3 года назад

    THANKS! You are a good teacher. It will be cool if you will show examples on real projects.
    For exmaple there is project structure
    handler
    service
    repository
    And in this structure everywhere pointers is used.

  • @btowers
    @btowers 3 года назад

    Thank you. Great tutorials!. Helped a lot...

  • @pawankumarmeena6737
    @pawankumarmeena6737 4 года назад +2

    can you suggest some golang projects for resume?

  • @Philantrope
    @Philantrope 2 года назад

    Well explained. Thanks for that!☺

  • @kaspariito
    @kaspariito 2 года назад

    This is great, all the seires of GO in that case..!

  • @Nexjsdeveloper
    @Nexjsdeveloper 2 года назад

    Thank you a lot.

  • @A.A.
    @A.A. 2 года назад

    thank you!

  • @donquixotedoflamingo5556
    @donquixotedoflamingo5556 4 года назад +2

    Tim can you do a Data Anaylst Tutorial?

  • @robertvocals
    @robertvocals 3 года назад +1

    I dont understand the function of for example "func (b *Reader) Read(p []byte) (n int, err error)" where it says: "Read reads data into p" but how can it reads data INTO p when there is no pointer to p and p is just a value to get from the function call ?

  • @learnweb3603
    @learnweb3603 Год назад

    Please do the regular videos in deep in golang

  • @glebeats3967
    @glebeats3967 2 года назад

    Hey man great tutorials, can you do a video about goroutines and channels?

  • @chickenmirchmasala2274
    @chickenmirchmasala2274 3 года назад

    @Tim Hello From India... I love the golang tutorial, I came so far watching the video. where are u from?

  • @Catharsiswitharthritis
    @Catharsiswitharthritis 9 месяцев назад

    dont we have arrow operators in go like in C ? For ex: s->age, rather than s.age

  • @piyushmahapatra5402
    @piyushmahapatra5402 3 года назад

    In javascript, we just pass the obj as an argument by reference, here we are taking the help of pointers to do the same.
    Correct ime if i am wrong

  • @nayalashmohammad8490
    @nayalashmohammad8490 4 года назад +2

    Golang API Tutorial please?

  • @siddarthsaha5364
    @siddarthsaha5364 Год назад

    Could we pass them by reference instead as pointers

  • @shhhhhhKoiHai
    @shhhhhhKoiHai 3 года назад

    Awesome 👍.

  • @spencernold8899
    @spencernold8899 2 года назад

    Wouldn't you need to specify that student is a pointer with &, or no?

  • @eric.m5790
    @eric.m5790 3 года назад

    nice thanks for the info

  • @FPChris
    @FPChris 2 года назад

    Why the underscore after ‘for’?

  • @mohsanabbas8787
    @mohsanabbas8787 3 года назад

    Thanks man...

  • @ammarif618
    @ammarif618 4 года назад

    I'm not fun of programming but I'm a big fun of the next level of programming

  • @seanlestermiranda
    @seanlestermiranda 3 года назад +1

    it seems that this achieves the same result as OOP style.

    • @snowcr
      @snowcr 3 года назад

      Although many hate OOP because a bad use of it can lead to messy and overcomplicated code, I find it to be very satisfying while implementing my solutions. When I saw Go didn't have objects/classes I panicked but after taking a look at this I felt relieved! Plus, this eliminates the confusion between structs and classes in other languages like C and C++. Go's looking very promising!

  • @xsw2ws891
    @xsw2ws891 4 года назад

    I think that sometimes some reference to python could be nice and helpful to understand better some particular topic, solution etc

    • @GuitarreroDaniel
      @GuitarreroDaniel 4 года назад +1

      Python isn't a prerequisite to learn Go, and it's definitely NOT NEEDED. If you have a background on C, C++, or even Java, you won't have any problems learning Go.

  • @jacksonmooring9785
    @jacksonmooring9785 4 года назад +1

    I thought you would have better grades :) 2:37

    • @xcvsdxvsx
      @xcvsdxvsx 3 года назад

      He spent too much time learning real skills and not enough time studying about "civil rights" and spanish.

  • @piotrbublik6219
    @piotrbublik6219 4 года назад +1

    Golang API

  • @hackzchannel7921
    @hackzchannel7921 4 года назад +1

    I don't really understand

    • @ammarif618
      @ammarif618 4 года назад

      You're only in need of watching the previous lessons so go out of here. I don't have time sir.

  • @aishwarya_namasya_chatrasya
    @aishwarya_namasya_chatrasya 3 года назад

    Is Tim just 19? as given in the tutorial

    • @mrAmal45
      @mrAmal45 2 года назад

      yes, tim is in his 20s now. Padikkunna pillarokke angane annu!!