1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-07 21:37:04 +09:00

GO-2835 fix vcs info on gomobile

This commit is contained in:
Roman Khafizianov 2024-02-07 15:01:31 +01:00
parent 6f70547023
commit a64abc85b3
No known key found for this signature in database
GPG key ID: F07A7D55A2684852

View file

@ -8,7 +8,7 @@ import (
)
var (
GitBranch, GitSummary string
GitBranch, GitSummary, BuildDate, GitCommit string
)
type VCSInfo struct {
@ -62,6 +62,14 @@ func GetVCSInfo() VCSInfo {
Summary: GitSummary,
CGO: true,
}
// we don't have a build date and commit in the gomobile builds, so inject it via linker flags
if BuildDate != "" {
info.BuildDate, _ = time.Parse(time.RFC3339, BuildDate)
}
if GitCommit != "" {
info.Revision = GitCommit
}
d, ok := debug.ReadBuildInfo()
if !ok {
return info