Unit testing in golang - a beginners + advanced-ish tutorial
ฝัง
- เผยแพร่เมื่อ 9 ก.ย. 2024
- You want to learn how to write unit tests in golang? In this tutorial I am explaining all the basics you need to know about how to write your very first tests in go. I also get into some advanced-ish techniques like parametrized testing and using testify.
Playlist:
• Advanced go tutorials
testify:
github.com/str...
❤️ SUPPORT MY CHANNEL ❤️
--------------------------------------------------
A little support goes a long way!
Buy me a coffee: www.buymeacoff...
Become a patreon: / thomaslanghorst
📖 5 Books to skyrocket your career 📖
----------------------------------------------------
THE EXPLANATION VIDEO - • 5 MUST READ Programmin...
amzn.to/3IahMMh - Automate the boring stuff with python
amzn.to/3lI4RcM - Head First Design Patterns
amzn.to/3Ea1KjZ - Extreme Programming Explained
amzn.to/3k7xhwn - Soft Skills
amzn.to/3KdEC8n - Clean Code
🎒 THE GEAR I USE 🎒
--------------------------------------------------
💻 Technical Gear
amzn.to/3Edp4h5 - Apple MacBook Pro M1
amzn.to/3KmaWFQ - Laptop Bag
amzn.to/412MNdt - Apple Magic Keyboard
amzn.to/3jXJ2pb - Mouse (Mac Version)
amzn.to/3I3umwJ - Mouse (Windows Version)
amzn.to/3YHVCYD - Mousepad
amzn.to/3YAoAtj - SSD External Hard Drive
amzn.to/3Sdj0e7 - SSD Protection Case
amzn.to/3XDdfr9 - Headphones
amzn.to/3lJqrgN - USB Hub
amzn.to/3KamAUo - HDMI to USB
🎒 Digital Nomad Essential Gear
amzn.to/3Sdjn8v - Bag
amzn.to/40ZLyf9 - Bullet Journal
amzn.to/41130zS - Fineliner Pens
amzn.to/3YNwUps - French Press / Plunger
amzn.to/3lI44sk - Mug
📷 TH-cam Gear
amzn.to/3k7bTra - Apple Iphone 13 mini (My "camera")
amzn.to/40ZbdEF - Tripod
amzn.to/3ZeMlY7 - Lightning to USB adapter for Microphones
amzn.to/3EdpSCD - Microphone
amzn.to/3Ee926A - Microphone Pop Protection
amzn.to/3S2AR7z - Selfie Ring Light
👋 SOCIAL MEDIA 👋
----------------------------------------------------
@the_langhorst - INSTAGRAM
@the_langhorst - TWITTER
@the_langhorst - TIKTOK
Music used:
Karl Casey @ White Bat Audio
• 80s Retrowave / Synthw...
Track: Sports Dubstep [Vlog Music] by MOKKA / Love in Space
• (No Copyright Music) S...
Music provided by "MokkaMusic" channel and
inaudio.org
‼️ Disclaimers
The links mentioned in this description may contain affiliate links. I may receive a commission for any purchases made through these links, but there won't be any extra cost for you. I am grateful for your support, as it enables me to keep providing you with valuable content for free.
#programming #coding #golang
maan, this was the most complete video about golang unit tests I've ever seen on youtube, thanks)))
testify please! :)
Alrighty, testify will be put onto my video idea list! Thanks for the comment, btw. Much appreciated!
This was probably the best video on go lang unit testing I've seen so far. I come from python unit testing with mock, and was able to understand everything. Good job!
wow...thank you so much! Reading such things is exactly why I do this! It makes me so incredibly happy!
Very engaging way of teaching. Good job!!
nice one , now i can do my opensource work !
I noticed that the testify library runs the tests in less time 👀
Nica tutorial 👌
Hey Daniel, thanks for the comment!
To be honest, I haven't noticed any significant speed boosts. I will investigate on that 🧐 . Thanks for pointing it out!!!
The video was very helpful. Thanks!
Nice tutorial, thanks 🙂
Thank you very much. I am glad you liked it.
Pretty straightforward, thanks.
Thanks man, really appreciated!
thank you, good one and to the point video :)
Thanks man, really appreciated!
excellent, i was able to solve some queries about golang testing :D
You are very welcome! Glad I could be of help!
I'd love a video for testify! seriously, nobody does any videos about unit testing. Its the same with nodejs, no one does anything with TSOA for nodejs unit testing.
Hey, thanks for the comment. Feedback like this is much appreciated! You are not the first who liked to have a video about testify. So I will make sure to create one. But it takes up more time and planning and structuring it. Be patient. But there will be a video on that!
Great video!!
Thanks, really appreciated!
very nice video
Thanks! I am glad you enjoyed it.
Very Helpful thank you. Will you be exploring mocking?
Hey Jeff, thanks for the comment! I am glad that I could be of help.
mocking is a great topic and I could actually talk about it for hours :D If more people want to see it, I will most certainly create a video about it.
I am getting the error "package command-line-arguments is not a main package" when using a package that has the same name as the filename (calculator in this case). How are you able to have a package calculator running in the code? Please guide.
Sir, I am currently learning c++, java and python is it enough or should i learn 1 more. (Not web development)
Hey. Thanks for the comment.
tl;dr: these three languages are more than enough.
Personally, I think that it is not about the amount of languages you know, but rather the concepts of programming. If you fully understand C++, Java or Python, learning another language is pretty simple. But I would not learn more languages, just for the sake of learning them. If you need to switch languages, because you want to switch your focus of work, that is ok. For instance, if you want to learn data science and you do not know Python. Then learn Python. But I would not learn Python simply to put it onto my résumé. So it depends on what you want to accomplish with learning another language. Is there any special need why you want to learn one more?
@@ThomasLanghorst thanks, what arebthe languages that you know?
Hey Rasika. Thanks for asking.
professionally:
Java, Kotlin, JS, Angular (+Typescript) and finally golang YAY
side projects:
I started with python and switched to golang about 3 years ago. I use VueJS for my frontends.