parsley v0.9.0
Pre-releaseChanges
-
Generate Mocks Command: A new CLI command,
generate mocks
, has been added. This feature lets you create configurable mock implementations directly from your interface types, streamlining your testing process. -
Configurable Mocks: Generated mock implementation types extend the new
MockBase
type, which allows registration of function callbacks, trace method calls, and verify function calls (counting, in combination with argument matching). This is an essential tool for speeding up the writing of test code for services with injected dependencies.
Key Changes
-
Internal Refactoring: I’ve made several improvements to the internal
generator
package, focusing on better error handling and increasing the package’s extensibility. -
Generic Code Generation: A new
generic_generator.go
module has been introduced, providing a more flexible and reusable template system for code generation. This enables quicker integration of additional template-based generators for interface models, making extending Parsley’s CLI capabilities easier. -
Improved Formatting: All generated code now adheres to Go's canonical
go fmt
style, ensuring clean and standardized output.
Important License Update
I am excited to announce that, starting with this release, the project's license has been changed from AGPLv3 to Apache License 2.0.
The move to the Apache 2.0 license reflects my desire to make the library more accessible and easier to adopt, especially in commercial and proprietary projects. The Apache 2.0 license is less restrictive than AGPLv3, allowing for broader usage scenarios without requiring derivative works to be open-sourced.
What does this mean for you?
-
Greater Flexibility: You can now use, modify, and distribute the library with fewer restrictions, even in proprietary software, without the obligation to disclose your source code.
-
Potential for Increased Contributions: While I understand that this change might reduce the obligation to contribute modifications back to the community, broader adoption may lead to more contributions over time as more developers use and improve the library.
I hope this change encourages more developers and organizations to integrate the Parsley library into their projects, fostering innovation and collaboration. I remain committed to maintaining and improving the library and welcome any contributions or feedback from our growing community.
For more details on the new license, please see the full text of the Apache License 2.0.