[#302] pkg/version: Document default values set in NewVersion

Document field values of instance constructed via
`NewVersion`. Assert the values in corresponding
unit test.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-06-08 21:25:35 +03:00 committed by Alex Vanin
parent 768adfdd15
commit dc99d4edce
2 changed files with 29 additions and 9 deletions

View file

@ -21,6 +21,10 @@ func NewVersionFromV2(v *refs.Version) *Version {
// NewVersion creates and initializes blank Version.
//
// Works similar as NewVersionFromV2(new(Version)).
//
// Defaults:
// - major: 0;
// - minor: 0.
func NewVersion() *Version {
return NewVersionFromV2(new(refs.Version))
}