Releases: rameshsunkara/go-rest-api-example
Releases · rameshsunkara/go-rest-api-example
v1.1.1 Auto detect race conditions
Code changes are here: #57
Fixes panic in tests:
Removes redundant t.Parallel() calls at the top level of test functions that use subtests, ensuring t.Parallel() is only called within subtest closures. This prevents the panic: testing: t.Parallel called multiple times error.
Test structure improvements:
Refactors table-driven tests to use proper parallelization patterns, increasing test isolation and reliability.
General test cleanup:
Ensures consistent error handling and assertion usage across test files.
Fixes race conditions and panics in tests caused by improper use of t.Parallel().
Improves test maintainability and reliability.
In addition to test changes
- Injects logger to all appropriate functions
- main.go is now modular and readable
- Removed deferrun dep which was dealing with signals to cleanup
v1.1.0
Changes in this release:
- Upgraded Go version to 1.24: Updated the project to use the latest stable version of Go, ensuring better performance, security, and access to new language features.
- Upgraded golangci-lint to v2: Integrated the latest version of golangci-lint (v2), improving static code analysis and linting capabilities to catch potential issues early.
- Optimized Dockerfile with BuildKit: The Dockerfile now leverages Docker BuildKit for more efficient builds, including enhanced caching and faster layer processing.
- Parallelized Build Workflow: The CI build pipeline has been updated to run tests and Docker builds in parallel, reducing build time and improving overall workflow efficiency.
This release focuses on performance improvements, build optimizations, and code quality enhancements.
Full Changelog: v1.0.1...v1.1.0
Makefile and Test execution improvements
- Updated Makefile to improve readability and maintainability
- Got rid of in memory mongodb usage for db test and used mtest from offical mongodb.
- Tests are now executed in parallel
- Updated redme to improve readbility
- Increased code coverage
v1.0.0 New features
Following are the newly added features
API Features:
- OWASP Compliant Open API 3 Spec
- Middleware for
- Logging : Helps in debugging and monitoring
- Authentication : Placeholder for different authentication mechanisms
- Tracing by Request ID : Helps in debugging
- Panic Recovery : Helps in keeping the service up
- Common Security Headers : Keeps the service secure
- Query Params Validation : Helps in keeping the service secure
- Standard Error Handling
- All errors are handled and returned in a standard format
- Versioning
- Model Management
- Generally, the data model used internally is different from the data model exposed to the client.
This helps in keeping the internal model separate from the exposed model.
- Generally, the data model used internally is different from the data model exposed to the client.
Go Application Features:
- Configuration Management through Environment Variables
- A Makefile to do all common tasks
- A Git Action to build, run tests, generate code coverage
- Integrated GO Formatter and Linter
- Mechanism to load secrets from Sidecar
- Enables connecting to multiple databases
- Follows the best practices for connecting to MongoDB
- Good mocking practises for Unit test patterns
- Standard filename conventions for better readability