github.com/anycable/anycable-go@v1.5.1/version/version.go (about)

     1  package version
     2  
     3  var (
     4  	version  string
     5  	modifier string
     6  	sha      string
     7  )
     8  
     9  func init() {
    10  	if version == "" {
    11  		version = "1.5.1"
    12  	}
    13  
    14  	if modifier != "" {
    15  		version = version + "-" + modifier
    16  	}
    17  
    18  	if sha != "" {
    19  		version = version + "-" + sha
    20  	}
    21  }
    22  
    23  // Version returns the current program version
    24  func Version() string {
    25  	return version
    26  }
    27  
    28  // SHA returns the build commit sha
    29  func SHA() string {
    30  	return sha
    31  }