Golang's Mocking Techniques - Kyle Yost | hatchpad Huddle

  Переглядів 35,103

hatchpad

hatchpad

3 роки тому

Golang's Mocking Techniques - Kyle Yost | hatchpad Huddle
🚀 Sign-Up for Weekly hatchpad Newsletter: www.myhatchpad.com/newsletter/
🔔 Get alerted about startup job openings: www.myhatchpad.com/job/submit...
During this discussion, Kyle Yost, a Software Engineer at CB Insights, will walk through the following 5 Mocking Techniques:
Higher-Order Functions
Monkey Patching
Interface Substitution
Embedding Interfaces
Mocking out Downstream HTTP Calls with net/http/httptest
🐣 What is hatchpad? 🐣
Hatchpad is the community for startup technologists.
Our members include Software Engineers, Product Managers, Data Scientists, and Tech Executives; all connected through their passion for startups and desire to create innovative technology.
Every week we chat with startup technologists to provide you behind the scenes insights on technical skills, career advice, and industry trends.
If you want to learn from and grow alongside a curated group of startup technical professionals, this community is for you.

КОМЕНТАРІ: 19
@waffleboot
@waffleboot 3 роки тому
16:16 "I need to mock a function" Higher Order Functions 20:30 "I need to mock a function" Monkey Patching 22:55 "I need to mock a method on a type" 25:55 "Accept interfaces, return structs" 27:00 "I have a large inteface, I need to mock a small set of its methods" 29:15 Embedding can be a hole in the type system 29:45 "I need to mock an HTTP call"
@olubodunagbalaya8765
@olubodunagbalaya8765 25 днів тому
2024 still super super helpful
@kevinkkirimii
@kevinkkirimii 3 місяці тому
Well done Kyle. As old as this is, it is so relevant and very informative. I love the 'large interface - small set' test. You have opened my mind to a pattern I can use even beyond mock testing. Have an air coffee on me. Thanks dude and be blessed.
@SeanMacdonald_CodeMonk
@SeanMacdonald_CodeMonk Місяць тому
excellent talk. Excellent comments. Excellent points. Excellent wisdom
@vedrandekovic
@vedrandekovic 3 роки тому
Probably the best explanation of the golang mocking on the web. Thank you!
@shub_zzz
@shub_zzz 3 роки тому
Wish I saw this video a year earlier when I started learning Go. My first language for work env is Go. And even after a 6 months I was not sure about unit testing in Go. This is really helpful for beginners!!!
@hereallyfast
@hereallyfast 3 місяці тому
The monkey patching thing is fire 🔥
@domemvs
@domemvs 2 місяці тому
Invaluable video. Thank you
@ultiumlabs4899
@ultiumlabs4899 2 роки тому
Kyle, it is really really helpful. Thank you.
@hatchpad1444
@hatchpad1444 2 роки тому
Glad it was helpful for you!
@sumer9999
@sumer9999 2 роки тому
A gem of a video
@hatchpad1444
@hatchpad1444 2 роки тому
Thanks for watching!
@imsachinraut
@imsachinraut 2 роки тому
Thank you so much Kyle Host for this superb unit testing video. Is there any way for testing channels, signals, goroutines, locks.
@Christo6020
@Christo6020 6 місяців тому
Great talk! Just to mention that nowadays gomock is archived, but Uber maintains a fork.
@hereallyfast
@hereallyfast 3 місяці тому
EDIT: Looks like you get to this at the end of the talk 😂. If you have a large interface and you need to test just a few of the methods then you need to be writing more SOLID and idiomatic go. "Interface Segregation Principle revolves around the idea that clients should not be forced to rely on methods they do not use. To achieve this, the principle suggests creating specific interfaces or classes tailored to the needs of individual clients."
@codertjay
@codertjay 4 місяці тому
Just got what i really want to know
@johnmyeager
@johnmyeager 3 роки тому
What IDE is he using when doing the demo? I usually just use Vim, but I'm considering my options. It's visible at ukposts.info/have/v-deo/hHWfjHisnHxz258.html
@Slash3b
@Slash3b 3 роки тому
goland
@hereallyfast
@hereallyfast 3 місяці тому
How about not mocking
Generics in Go - Presented by Damien Stanton | hatchpad Huddle
46:32
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Переглядів 201 тис.
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Переглядів 109 млн
Teenagers Show Kindness by Repairing Grandmother's Old Fence #shorts
00:37
Fabiosa Best Lifehacks
Переглядів 33 млн
Генерация и использование моков в Go / Mockery
23:35
Николай Тузов — Golang
Переглядів 15 тис.
When To Unit, E2E, And Integration Test
14:58
ThePrimeTime
Переглядів 84 тис.
Go Pointers: When & How To Use Them Efficiently
14:09
Anthony GG
Переглядів 61 тис.
Practical Explanation of Golang INTERFACES
8:27
Tiago
Переглядів 2,7 тис.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Переглядів 87 тис.
Testing with golang and testify - tutorial part 1
13:45
Thomas Langhorst
Переглядів 11 тис.
Master Golang with Interfaces
21:54
Kantan Coding
Переглядів 3,4 тис.
Best OS for programming? Mac vs Windows vs Linux debate settled
8:40
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Переглядів 109 млн