I love how simple testing is in Go - Go / Golang Testing Tutorial

preview_player
Показать описание

Its not uncommon to change code you've already written for various reasons. The problem is we tend to break it when we do that. So what do you do? You write tests!

The go standard library has a testing package built into it, which works surprisingly well. I get you up to speed on how to write a basic test and a table drive test to back up any code changes you may make to your existing code.

### THANK YOU ###
Newest Channel Member -
Newest Subscriber - Phillip Lineburg

### WANT TO SUPPORT THE CHANNEL? ###

### WANT TO ASK ME A QUESTION? ###

### SOCIAL PLATFORMS ###

### VIDEO PLATFORMS ###

### OTHER THINGS ###

### SOFTWARE I USE ###

Thank ya'll for your time and support!

#golang #go #testing #tabledriventests
Рекомендации по теме
Комментарии
Автор

If ya'll got any questions relating to writing tests in Go, just let me know

DonaldFeury
Автор

"We have introduced what's called a regression, which is a fancy word for saying you broke shit that already worked" ♥️♥️♥️♥️

roko
Автор

First things first: Thanks for you gread videos here at youtube. I found this channel a few minutes ago and as there a a lot of interesting videos I already subscribed to your channel ;)

Two things:
1. Should not (in line 19) the 'testCase.input' be 'result'?
2. The package name in the test package can be mail_test. Main must then be imported then but if you build a project then the tests are more separated and should´nt be included in the binary. No idea why the should be included anyways.

Syhtet
Автор

Very good stuff in this one. Thank you!

patrickjoly
Автор

Go beginner here - thanks for the awesome videos! I think I understand most of this, but why is testCases a slice of an anonymous struct? I know what an anonymous struct is, but not sure why a slice is used. Thanks

azraelgm
visit shbcf.ru