Created
February 2, 2019 14:33
-
-
Save syntaqx/11525600c1c1f87ed6b5e4e9e91e3e66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (p *CmPlugin) GetMetadata() plugin.PluginMetadata { | |
metadata := plugin.PluginMetadata{ | |
Name: PLUGIN_NAME, | |
Version: pluginVersion, | |
MinCliVersion: plugin.VersionType{ | |
Major: 0, | |
Minor: 13, | |
Build: 0, | |
}, | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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