MCPcopy Index your code
hub / github.com/syncthing/syncthing / buildStamp

Function buildStamp

build.go:1057–1072  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1055}
1056
1057func buildStamp() int64 {
1058 // If SOURCE_DATE_EPOCH is set, use that.
1059 if s, _ := strconv.ParseInt(os.Getenv("SOURCE_DATE_EPOCH"), 10, 64); s > 0 {
1060 return s
1061 }
1062
1063 // Try to get the timestamp of the latest commit.
1064 bs, err := runError("git", "show", "-s", "--format=%ct")
1065 if err != nil {
1066 // Fall back to "now".
1067 return time.Now().Unix()
1068 }
1069
1070 s, _ := strconv.ParseInt(string(bs), 10, 64)
1071 return s
1072}
1073
1074func buildUser() string {
1075 if v := os.Getenv("BUILD_USER"); v != "" {

Callers 2

rebuildAssetsFunction · 0.85
ldflagsFunction · 0.85

Calls 2

runErrorFunction · 0.85
NowMethod · 0.65

Tested by

no test coverage detected