Go Module/Package v2 and after
Create Golang Module/package v2 and after with example.
We will start with example project firstname.lastname@example.org hosted on Github.
Updating Version for Go Package
Upgrade/tagging the package from v0.0.0 to v1.0.0:
- no change is required for
lib/output.gowas updated for output only.
This will hold true for all tagging before v2.x.x.
v2.0.0 and After
Releasing Go package v2.0.0 and above, extra steps are required for each major releases.
/v<major version>to the end of module line inside
If package is importing it own subfolder, those
importlines need to be update accordingly.
These steps need to be repeated every time the major version increases.
The example repository has up to v3.0.0.
Using V2 and Above
Similar rules apply when importing modules/libraries that are version two or above. For example, to use version 2 of
lib from the sample package, we have to add
And the import line will be same as above:
- Initial commit
The MIT License (MIT)
Copyright © 2022 John, Sing Dao, Siu email@example.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.