package appmeta

import "sync/atomic"

var appVersion atomic.Value

func init() {
	appVersion.Store("dev")
}

// SetVersion configures the running application version string.
func SetVersion(v string) {
	if v == "" {
		v = "dev"
	}
	appVersion.Store(v)
}

// Version returns the running application version string.
func Version() string {
	if v, ok := appVersion.Load().(string); ok && v != "" {
		return v
	}
	return "dev"
}

