this post was submitted on 28 Jul 2023
10 points (91.7% liked)

Golang

2417 readers
2 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 2 years ago
MODERATORS
10
The adapter pattern in Go (bitfieldconsulting.com)
submitted 2 years ago by nebiros to c/golang
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 2 years ago

Yes by all means, split your business logic from your infrastructure layer, but for the love of god don't use sqlmock. It's 2023, we have testcontainers and the ability to relatively simply - and reliably - host external dependencies locally. With a MySQL or Postgres instance there isn't really an excuse anymore to not be testing the integration.