Skip to content

Instantly share code, notes, and snippets.

@syntaqx
Created February 2, 2019 14:33
Show Gist options
  • Save syntaqx/11525600c1c1f87ed6b5e4e9e91e3e66 to your computer and use it in GitHub Desktop.
Save syntaqx/11525600c1c1f87ed6b5e4e9e91e3e66 to your computer and use it in GitHub Desktop.
func (p *CmPlugin) GetMetadata() plugin.PluginMetadata {
metadata := plugin.PluginMetadata{
Name: PLUGIN_NAME,
Version: pluginVersion,
MinCliVersion: plugin.VersionType{
Major: 0,
Minor: 13,
Build: 0,
},
package plugin
import (
"github.com/blang/semver"
)
var pluginVersionStruct = plugin.VersionType{
Major: 0,
Minor: 1,
Build: 0,
}
var (
version = "0.0.0"
pluginVersion *semver.Version
)
func init() {
pluginVersion, err := semver.Parse(version)
if err != nil {
panic(fmt.Sprintf("invalid value for semver %v", err))
}
pluginVersionStruct.Major = semver.Major
pluginVersionStruct.Minor = semver.Minor
pluginVersionStruct.Build = semver.Build
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment