make skip_reason optional
This commit is contained in:
9
api.go
9
api.go
@@ -30,13 +30,13 @@ type ThinPackage struct {
|
||||
Repo string `json:"repo"`
|
||||
SplitPackages []string `json:"split_packages"`
|
||||
Status dbpackage.Status `json:"status"`
|
||||
SkipReason string `json:"skip_reason"`
|
||||
SkipReason *string `json:"skip_reason,omitempty"`
|
||||
LTO dbpackage.Lto `json:"lto"`
|
||||
DebugSymbols dbpackage.DebugSymbols `json:"debug_symbols"`
|
||||
ArchVersion string `json:"arch_version"`
|
||||
RepoVersion string `json:"repo_version"`
|
||||
BuildDate string `json:"build_date"`
|
||||
PeakMem *string `json:"peak_mem"`
|
||||
PeakMem *string `json:"peak_mem,omitempty"`
|
||||
}
|
||||
|
||||
type PackageResponse struct {
|
||||
@@ -160,13 +160,16 @@ func GetPackages(w http.ResponseWriter, r *http.Request) {
|
||||
Repo: mPkg.Repository.String() + "-" + mPkg.March,
|
||||
SplitPackages: mPkg.Packages,
|
||||
Status: mPkg.Status,
|
||||
SkipReason: mPkg.SkipReason,
|
||||
LTO: mPkg.Lto,
|
||||
DebugSymbols: mPkg.DebugSymbols,
|
||||
ArchVersion: mPkg.Version,
|
||||
RepoVersion: mPkg.RepoVersion,
|
||||
}
|
||||
|
||||
if mPkg.SkipReason != "" {
|
||||
nPkg.SkipReason = &mPkg.SkipReason
|
||||
}
|
||||
|
||||
if !mPkg.BuildTimeStart.IsZero() {
|
||||
nPkg.BuildDate = mPkg.BuildTimeStart.UTC().Format(time.RFC1123)
|
||||
}
|
||||
|
Reference in New Issue
Block a user