Sometimes you want to test your code with mocks and here is a mock for messaging queue. It tries to mimic the NATS concepts and for sure it cannot. It doesn't have any dependencies except Go standard libraries, and you can easily use it in your tests.
mmq := cmq.NewMockMessageQueue[int]()
// register two different subscribing groups.
// create a subscribe groip on "numbers" topic which is named "s1"
mmq.Register("s1", "numbers", 10)
// create a subscribe groip on "numbers" topic which is named "s2"
mmq.Register("s2", "numbers", 10)