omit builddate if not build
This commit is contained in:
5
api.go
5
api.go
@@ -35,7 +35,7 @@ type ThinPackage struct {
|
||||
DebugSymbols dbpackage.DebugSymbols `json:"debug_symbols"`
|
||||
ArchVersion string `json:"arch_version"`
|
||||
RepoVersion string `json:"repo_version"`
|
||||
BuildDate string `json:"build_date"`
|
||||
BuildDate *string `json:"build_date,omitempty"`
|
||||
PeakMem *string `json:"peak_mem,omitempty"`
|
||||
}
|
||||
|
||||
@@ -171,7 +171,8 @@ func GetPackages(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if !mPkg.BuildTimeStart.IsZero() {
|
||||
nPkg.BuildDate = mPkg.BuildTimeStart.UTC().Format(time.RFC1123)
|
||||
formattedBuildDate := mPkg.BuildTimeStart.UTC().Format(time.RFC1123)
|
||||
nPkg.BuildDate = &formattedBuildDate
|
||||
}
|
||||
|
||||
if mPkg.MaxRss != nil {
|
||||
|
Reference in New Issue
Block a user