Documentation ¶
Overview ¶
Package versioning is a version comparison tool that conforms to semantic version 2.0.0
Copyright 2022 AndeyaLee Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SemVer ¶
type SemVer struct {
// contains filtered or unexported fields
}
SemVer semantic version object via https://semver.org/
func Parse ¶
Parse parses the semantic version string to object. NOTE: If metadata part exists, the separator must not be a number.
func (*SemVer) Compare ¶
Compare compares whether 's' and 'semVer'. The result will be 0 if s==semVer, -1 if s < semVer, and +1 if s > semVer. If compareMetadata==nil, will not compare metadata.