Refactor and test fixes #66
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the handling of queue and exchange types in the RabbitMQ AMQP package, simplifying type usage and improving test reliability. The main changes include removing wrapper structs for queue and exchange types in favor of using plain type aliases, updating all related interfaces and methods, and refactoring tests to use better setup/teardown patterns and more idiomatic assertions.
Refactoring of queue and exchange type handling
QueueType
andExchangeType
wrapper structs and their associated.String()
methods, replacing them with direct usage of theTQueueType
andTExchangeType
type aliases throughout the codebase. All interfaces, specifications, and related methods now use these aliases directly. [1] [2].String()
. [1] [2] [3] [4] [5]Updates to queue and exchange classes
AmqpExchange
andAmqpQueue
classes to use the new type aliases for setting and getting types, simplifying their APIs and internal logic. [1] [2] [3]Test improvements
sync.WaitGroup
, replacing it withBeforeEach
andAfterEach
hooks for setup and cleanup, and improved assertion style to useExpect(...).ToNot(HaveOccurred())
for error checks. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]