Using Badger DB for Golang Projects + Writing Tests



Using Badger DB for Golang Projects + Writing Tests

Using Badger DB for Golang Projects + Writing Tests

https://github.com/bashbunni/stream-bot
https://github.com/dgraph-io/badger

I hope you’re looking forward to more #golangtutorial and #golang videos! I’m excited to have more Go and general programming content on this channel as it’s been mainly about my editor so far heh. I hope you enjoy! If you’re looking to see how I built this, check out my twitch channel so you can see what the process looks like live.

Some Repository Pattern Resources: (feel free to comment your own!)
https://martinfowler.com/eaaCatalog/repository.html
https://levelup.gitconnected.com/practical-ddd-in-golang-repository-d308c9d79ba7
https://github.com/censhin/repository-pattern-go

Keep in touch:
https://twitch.tv/bashbunni
https://twitter.com/sudobunni
https://discord.com/invite/Y3vbKS4K9j

Music from #Uppbeat (free for Creators!):
https://uppbeat.io/t/prigida/moonshine
License code: SYPM3XLUFRCRESIT

Chapters:
0:00 Intro
0:09 What We’re Building
0:25 Repository Pattern
0:45 GetAll()
0:53 Badger Transactions
1:34 SetValue()
2:00 EditValue()
2:16 GetValue()
2:56 DeleteValue()
3:59 Tests
4:59 Why I’m Writing Tests
5:20 Table-Driven Tests in Go
5:48 Test Setup
6:22 Describing The Test Body
7:17 TestGetValue()
7:31 Found potential bug
7:53 More improvements
7:59 Why Write Tests
8:48 InitInMemoryDB()
9:11 Feedback?
9:19 I build this all live, btw
9:33 Outro

Comments are closed.