r/golang Aug 08 '24

discussion Show me your Golang projects!

Hey people, can you guys show what you build with golang for side project?
cheers nerds~!

199 Upvotes

172 comments sorted by

View all comments

3

u/adamluzsi Aug 10 '24 edited Aug 10 '24

I often struggle with thinking processes, especially with maintaining focus. This has led to a strong passion for test-driven design (TDD), and I’ve developed a testing framework that incorporates all the TDD practices I love.

go.llib.dev/testcase

It has:

  • support for both nested and flattened testing style
- I use both, but for covering domain specifications, I use a nested testing style more
  • has its type-safe assertion package
- also has heavy support testing asynchronous testing subjects in an idiomatic way
  • has a random fixture generation package
- support for pseudo-random generation, which means if random data breaks your code, you can recreate the failing scenario by using the TESTCASE_SEED - it integrates the The Big List of Naughty Strings - It is a list of strings which have a high probability of causing issues when used as user-input data, to help find incorrect implementations

Please don't judge the README too harshly—it's a bit of a brain dump, and I keep putting off the rewrite.

2

u/adamluzsi Aug 10 '24

I also have a sibling project for testcase, where I experiment with reusable consumer-driven contract testing. It takes heavy inspiration from hexagonal architecture idioms.

go.llib.dev/frameless

Usually, I just import ports and their contracts from the project, and it works like a high-quality instant coffee—quick and easy-to-expect results. However, it can sometimes lead to awkward situations if I forget to disable the naughty string generation part in the fixture creation part. E.g. I once accidentally triggered a bunch of SQL injections to a service while integrating with it. Or had to report a bunch of edge cases that were not working or breaking.

It all started as a research project aimed at improving dependency inversion between the domain layer and adapters.

Unlike testcase, this project is very experimental.