github.com/myafeier/fabric@v1.0.1-0.20170722181825-3a4b1f2bce86/orderer/common/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  	common "github.com/hyperledger/fabric/common/metadata"
    14  )
    15  
    16  // package-scoped variables
    17  
    18  // Package version
    19  var Version string
    20  
    21  // package-scoped constants
    22  
    23  // Program name
    24  const ProgramName = "orderer"
    25  
    26  func GetVersionInfo() string {
    27  	Version = common.Version
    28  	if Version == "" {
    29  		Version = "development build"
    30  	}
    31  
    32  	return fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s",
    33  		ProgramName, Version, runtime.Version(),
    34  		fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH))
    35  }