This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +1
-24
lines changed Expand file tree Collapse file tree 3 files changed +1
-24
lines changed Original file line number Diff line number Diff line change 1
1
include vars.mk
2
2
3
- ifeq ($(BUILDTIME ) ,)
4
- BUILDTIME := $(shell date -u +"% Y-% m-% dT% H:% M:% SZ" 2> /dev/null)
5
- endif
6
- ifeq ($(BUILDTIME ) ,)
7
- BUILDTIME := unknown
8
- $(warning unable to set BUILDTIME. Set the value manually)
9
- endif
10
-
11
3
LDFLAGS := "-s -w \
12
4
-X $(PKG_NAME ) /internal.GitCommit=$(COMMIT ) \
13
- -X $(PKG_NAME ) /internal.Version=$(TAG ) \
14
- -X $(PKG_NAME ) /internal.BuildTime=$(BUILDTIME ) "
5
+ -X $(PKG_NAME ) /internal.Version=$(TAG ) "
15
6
16
7
EXEC_EXT :=
17
8
ifeq ($(OS ) ,Windows_NT)
Original file line number Diff line number Diff line change @@ -4,35 +4,22 @@ import (
4
4
"fmt"
5
5
"runtime"
6
6
"strings"
7
- "time"
8
7
)
9
8
10
9
var (
11
10
// Version is the git tag that this was built from.
12
11
Version = "unknown"
13
12
// GitCommit is the commit that this was built from.
14
13
GitCommit = "unknown"
15
- // BuildTime is the time at which the binary was built.
16
- BuildTime = "unknown"
17
14
)
18
15
19
16
// FullVersion returns a string of version information.
20
17
func FullVersion () string {
21
18
res := []string {
22
19
fmt .Sprintf ("Version: %s" , Version ),
23
20
fmt .Sprintf ("Git commit: %s" , GitCommit ),
24
- fmt .Sprintf ("Built: %s" , reformatDate (BuildTime )),
25
21
fmt .Sprintf ("OS/Arch: %s/%s" , runtime .GOOS , runtime .GOARCH ),
26
22
}
27
23
28
24
return strings .Join (res , "\n " )
29
25
}
30
-
31
- // FIXME(chris-crone): use function in docker/cli/cli/command/system/version.go.
32
- func reformatDate (buildTime string ) string {
33
- t , errTime := time .Parse (time .RFC3339Nano , buildTime )
34
- if errTime == nil {
35
- return t .Format (time .ANSIC )
36
- }
37
- return buildTime
38
- }
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ ifeq ($(SHELL),sh.exe)
11
11
rm = del /F /Q $(subst /,\,$(1 ) ) > nul 2>&1 || (exit 0)
12
12
rmdir = rmdir /S /Q $(subst /,\,$(1 ) ) > nul 2>&1 || (exit 0)
13
13
chmod =
14
- BUILDTIME ?= unknown
15
14
NULL := nul
16
15
else
17
16
# The no-op redirection forces make to shell out the commands instead of spawning a process as
You can’t perform that action at this time.
0 commit comments