-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add version pkg for Vela #112
Conversation
Codecov Report
@@ Coverage Diff @@
## master #112 +/- ##
=======================================
Coverage 99.20% 99.20%
=======================================
Files 46 48 +2
Lines 2759 2784 +25
=======================================
+ Hits 2737 2762 +25
Misses 12 12
Partials 10 10
|
GitCommit: %s, | ||
GoVersion: %s, | ||
OperatingSystem: %s, | ||
}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the format if we were to output the Metadata
from the struct.
GoVersion: %s, | ||
OperatingSystem: %s, | ||
} | ||
}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the format if we were to output the entire Version
struct.
// Meta implements a formatted string containing only metadata for the Version type. | ||
func (v *Version) Meta() string { | ||
return v.Metadata.String() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the function used to return only the Metadata
from the version.
// Semantic implements a formatted string containing a formal semantic version for the Version type. | ||
func (v *Version) Semantic() string { | ||
return v.Canonical | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the function used to return only the canonical reference of the semantic version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐬
Implementing a custom
Version
type for Vela that can be referenced throughout the different repos.When rendered as JSON the output looks like:
Beyond the
String()
functions, this package also supports two different functions:Meta()
- returns only the metadata surrounding the version of the applicationSemantic()
- returns only the canonical semantic version of the application