mirror of
https://github.com/larksuite/cli.git
synced 2026-07-04 06:29:52 +08:00
24 lines
492 B
Go
24 lines
492 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package build
|
|
|
|
import "runtime/debug"
|
|
|
|
// Version is dynamically set by -ldflags or falls back to module info.
|
|
var Version = "DEV"
|
|
|
|
// Date is the build date in YYYY-MM-DD format, set by -ldflags.
|
|
var Date = ""
|
|
|
|
func init() {
|
|
if Version == "DEV" {
|
|
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "(devel)" {
|
|
Version = info.Main.Version
|
|
}
|
|
}
|
|
if Version == "" {
|
|
Version = "DEV"
|
|
}
|
|
}
|