github.com/myafeier/fabric@v1.0.1-0.20170722181825-3a4b1f2bce86/common/tools/cryptogen/metadata/metadata.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package metadata
     8  
     9  import (
    10  	"fmt"
    11  	"runtime"
    12  )
    13  
    14  // package-scoped variables
    15  
    16  // Package version
    17  var Version string
    18  
    19  // package-scoped constants
    20  
    21  // Program name
    22  const ProgramName = "cryptogen"
    23  
    24  func GetVersionInfo() string {
    25  	if Version == "" {
    26  		Version = "development build"
    27  	}
    28  
    29  	return fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s",
    30  		ProgramName, Version, runtime.Version(),
    31  		fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH))
    32  }