cubefs/proto/version.go
slasher 4ae8eb48e7 chore(proto): golangci lint apply into proto
Signed-off-by: slasher <shenjie1@oppo.com>
2024-01-12 14:21:16 +08:00

30 lines
510 B
Go

package proto
import (
"fmt"
"runtime"
)
//TODO: remove this later.
//go:generate golangci-lint run --issues-exit-code=1 -D errcheck -E bodyclose .
var (
Version string
CommitID string
BranchName string
BuildTime string
)
func DumpVersion(role string) string {
return fmt.Sprintf("CubeFS %s\n"+
"Version : %s\n"+
"Branch : %s\n"+
"Commit : %s\n"+
"Build : %s %s %s %s\n",
role,
Version,
BranchName,
CommitID,
runtime.Version(), runtime.GOOS, runtime.GOARCH, BuildTime)
}