@@ -77,8 +77,8 @@ var apiHandlers = map[string]APIHandler{
7777 "log_to_repro" : nsHandler (apiLogToReproduce ),
7878}
7979
80- type JSONHandler func (c context.Context , r * http.Request ) (interface {} , error )
81- type APIHandler func (c context.Context , payload io.Reader ) (interface {} , error )
80+ type JSONHandler func (c context.Context , r * http.Request ) (any , error )
81+ type APIHandler func (c context.Context , payload io.Reader ) (any , error )
8282
8383const (
8484 maxReproPerBug = 10
@@ -126,7 +126,7 @@ func handleJSON(fn JSONHandler) http.Handler {
126126 })
127127}
128128
129- func handleAPI (c context.Context , r * http.Request ) (interface {} , error ) {
129+ func handleAPI (c context.Context , r * http.Request ) (any , error ) {
130130 client := r .PostFormValue ("client" )
131131 method := r .PostFormValue ("method" )
132132 log .Infof (c , "api %q from %q" , method , client )
@@ -178,7 +178,7 @@ func contextNamespace(c context.Context) string {
178178// gcsPayloadHandler json.Decode the gcsURL from payload and stream pointed content.
179179// This function streams ungzipped content in order to be aligned with other wrappers/handlers.
180180func gcsPayloadHandler (handler APIHandler ) APIHandler {
181- return func (c context.Context , payload io.Reader ) (interface {} , error ) {
181+ return func (c context.Context , payload io.Reader ) (any , error ) {
182182 var gcsURL string
183183 if err := json .NewDecoder (payload ).Decode (& gcsURL ); err != nil {
184184 return nil , fmt .Errorf ("json.NewDecoder(payload).Decode(&gcsURL): %w" , err )
@@ -216,7 +216,7 @@ func nsHandler[Req any](handler func(context.Context, string, *Req) (any, error)
216216}
217217
218218func typedHandler [Req any ](handler func (context.Context , * Req ) (any , error )) APIHandler {
219- return func (ctx context.Context , payload io.Reader ) (interface {} , error ) {
219+ return func (ctx context.Context , payload io.Reader ) (any , error ) {
220220 req := new (Req )
221221 if payload != nil {
222222 if err := json .NewDecoder (payload ).Decode (req ); err != nil {
@@ -227,12 +227,12 @@ func typedHandler[Req any](handler func(context.Context, *Req) (any, error)) API
227227 }
228228}
229229
230- func apiLogError (c context.Context , req * dashapi.LogEntry ) (interface {} , error ) {
230+ func apiLogError (c context.Context , req * dashapi.LogEntry ) (any , error ) {
231231 log .Errorf (c , "%v: %v" , req .Name , req .Text )
232232 return nil , nil
233233}
234234
235- func apiBuilderPoll (c context.Context , ns string , req * dashapi.BuilderPollReq ) (interface {} , error ) {
235+ func apiBuilderPoll (c context.Context , ns string , req * dashapi.BuilderPollReq ) (any , error ) {
236236 bugs , _ , err := loadAllBugs (c , func (query * db.Query ) * db.Query {
237237 return query .Filter ("Namespace=" , ns ).
238238 Filter ("Status<" , BugStatusFixed )
@@ -277,7 +277,7 @@ func reportEmail(c context.Context, ns string) string {
277277 return ""
278278}
279279
280- func apiCommitPoll (c context.Context , ns string , req * any ) (interface {} , error ) {
280+ func apiCommitPoll (c context.Context , ns string , req * any ) (any , error ) {
281281 resp := & dashapi.CommitPollResp {
282282 ReportEmail : reportEmail (c , ns ),
283283 }
@@ -343,7 +343,7 @@ func pollBackportCommits(c context.Context, ns string, count int) ([]string, err
343343 return backportTitles , nil
344344}
345345
346- func apiUploadCommits (c context.Context , ns string , req * dashapi.CommitPollResultReq ) (interface {} , error ) {
346+ func apiUploadCommits (c context.Context , ns string , req * dashapi.CommitPollResultReq ) (any , error ) {
347347 // This adds fixing commits to bugs.
348348 err := addCommitsToBugs (c , ns , "" , nil , req .Commits )
349349 if err != nil {
@@ -444,7 +444,7 @@ func addCommitInfoToBugImpl(c context.Context, bug *Bug, com dashapi.Commit) (bo
444444 return changed , nil
445445}
446446
447- func apiJobPoll (c context.Context , req * dashapi.JobPollReq ) (interface {} , error ) {
447+ func apiJobPoll (c context.Context , req * dashapi.JobPollReq ) (any , error ) {
448448 if stop , err := emergentlyStopped (c ); err != nil || stop {
449449 // The bot's operation was aborted. Don't accept new crash reports.
450450 return & dashapi.JobPollResp {}, err
@@ -455,17 +455,17 @@ func apiJobPoll(c context.Context, req *dashapi.JobPollReq) (interface{}, error)
455455 return pollPendingJobs (c , req .Managers )
456456}
457457
458- func apiJobDone (c context.Context , req * dashapi.JobDoneReq ) (interface {} , error ) {
458+ func apiJobDone (c context.Context , req * dashapi.JobDoneReq ) (any , error ) {
459459 err := doneJob (c , req )
460460 return nil , err
461461}
462462
463- func apiJobReset (c context.Context , req * dashapi.JobResetReq ) (interface {} , error ) {
463+ func apiJobReset (c context.Context , req * dashapi.JobResetReq ) (any , error ) {
464464 err := resetJobs (c , req )
465465 return nil , err
466466}
467467
468- func apiUploadBuild (c context.Context , ns string , req * dashapi.Build ) (interface {} , error ) {
468+ func apiUploadBuild (c context.Context , ns string , req * dashapi.Build ) (any , error ) {
469469 now := timeNow (c )
470470 _ , isNewBuild , err := uploadBuild (c , now , ns , req , BuildNormal )
471471 if err != nil {
@@ -732,7 +732,7 @@ func managerList(c context.Context, ns string) ([]string, error) {
732732 return managers , nil
733733}
734734
735- func apiReportBuildError (c context.Context , ns string , req * dashapi.BuildErrorReq ) (interface {} , error ) {
735+ func apiReportBuildError (c context.Context , ns string , req * dashapi.BuildErrorReq ) (any , error ) {
736736 now := timeNow (c )
737737 build , _ , err := uploadBuild (c , now , ns , & req .Build , BuildFailed )
738738 if err != nil {
@@ -762,7 +762,7 @@ const (
762762 suppressedReportTitle = "suppressed report"
763763)
764764
765- func apiReportCrash (c context.Context , ns string , req * dashapi.Crash ) (interface {} , error ) {
765+ func apiReportCrash (c context.Context , ns string , req * dashapi.Crash ) (any , error ) {
766766 if stop , err := emergentlyStopped (c ); err != nil || stop {
767767 // The bot's operation was aborted. Don't accept new crash reports.
768768 return & dashapi.ReportCrashResp {}, err
@@ -1067,7 +1067,7 @@ func purgeOldCrashes(c context.Context, bug *Bug, bugKey *db.Key) {
10671067 log .Infof (c , "deleted %v crashes for bug %q" , deleted , bug .Title )
10681068}
10691069
1070- func apiReportFailedRepro (c context.Context , ns string , req * dashapi.CrashID ) (interface {} , error ) {
1070+ func apiReportFailedRepro (c context.Context , ns string , req * dashapi.CrashID ) (any , error ) {
10711071 req .Title = canonicalizeCrashTitle (req .Title , req .Corrupted , req .Suppressed )
10721072 bug , err := findExistingBugForCrash (c , ns , []string {req .Title })
10731073 if err != nil {
@@ -1134,7 +1134,7 @@ func saveReproAttempt(c context.Context, bug *Bug, build *Build, log []byte) err
11341134 return nil
11351135}
11361136
1137- func apiNeedRepro (c context.Context , ns string , req * dashapi.CrashID ) (interface {} , error ) {
1137+ func apiNeedRepro (c context.Context , ns string , req * dashapi.CrashID ) (any , error ) {
11381138 if req .Corrupted {
11391139 resp := & dashapi.NeedReproResp {
11401140 NeedRepro : false ,
@@ -1182,7 +1182,7 @@ func normalizeCrashTitle(title string) string {
11821182 return strings .TrimSpace (limitLength (title , maxTextLen ))
11831183}
11841184
1185- func apiManagerStats (c context.Context , ns string , req * dashapi.ManagerStatsReq ) (interface {} , error ) {
1185+ func apiManagerStats (c context.Context , ns string , req * dashapi.ManagerStatsReq ) (any , error ) {
11861186 now := timeNow (c )
11871187 err := updateManager (c , ns , req .Name , func (mgr * Manager , stats * ManagerStats ) error {
11881188 mgr .Link = req .Addr
@@ -1203,7 +1203,7 @@ func apiManagerStats(c context.Context, ns string, req *dashapi.ManagerStatsReq)
12031203 return nil , err
12041204}
12051205
1206- func apiUpdateReport (c context.Context , ns string , req * dashapi.UpdateReportReq ) (interface {} , error ) {
1206+ func apiUpdateReport (c context.Context , ns string , req * dashapi.UpdateReportReq ) (any , error ) {
12071207 bug := new (Bug )
12081208 bugKey := db .NewKey (c , "Bug" , req .BugID , 0 , nil )
12091209 if err := db .Get (c , bugKey , bug ); err != nil {
@@ -1229,7 +1229,7 @@ func apiUpdateReport(c context.Context, ns string, req *dashapi.UpdateReportReq)
12291229 return nil , runInTransaction (c , tx , nil )
12301230}
12311231
1232- func apiBugList (c context.Context , ns string , req * any ) (interface {} , error ) {
1232+ func apiBugList (c context.Context , ns string , req * any ) (any , error ) {
12331233 keys , err := db .NewQuery ("Bug" ).
12341234 Filter ("Namespace=" , ns ).
12351235 KeysOnly ().
@@ -1244,7 +1244,7 @@ func apiBugList(c context.Context, ns string, req *any) (interface{}, error) {
12441244 return resp , nil
12451245}
12461246
1247- func apiLoadBug (c context.Context , ns string , req * dashapi.LoadBugReq ) (interface {} , error ) {
1247+ func apiLoadBug (c context.Context , ns string , req * dashapi.LoadBugReq ) (any , error ) {
12481248 bug := new (Bug )
12491249 bugKey := db .NewKey (c , "Bug" , req .ID , 0 , nil )
12501250 if err := db .Get (c , bugKey , bug ); err != nil {
@@ -1256,7 +1256,7 @@ func apiLoadBug(c context.Context, ns string, req *dashapi.LoadBugReq) (interfac
12561256 return loadBugReport (c , bug )
12571257}
12581258
1259- func apiLoadFullBug (c context.Context , req * dashapi.LoadFullBugReq ) (interface {} , error ) {
1259+ func apiLoadFullBug (c context.Context , req * dashapi.LoadFullBugReq ) (any , error ) {
12601260 bug , bugKey , err := findBugByReportingID (c , req .BugID )
12611261 if err != nil {
12621262 return nil , fmt .Errorf ("failed to find the bug: %w" , err )
@@ -1282,7 +1282,7 @@ func loadBugReport(c context.Context, bug *Bug) (*dashapi.BugReport, error) {
12821282 return createBugReport (c , bug , crash , crashKey , bugReporting , reporting )
12831283}
12841284
1285- func apiAddBuildAssets (c context.Context , ns string , req * dashapi.AddBuildAssetsReq ) (interface {} , error ) {
1285+ func apiAddBuildAssets (c context.Context , ns string , req * dashapi.AddBuildAssetsReq ) (any , error ) {
12861286 assets := []Asset {}
12871287 for i , toAdd := range req .Assets {
12881288 asset , err := parseIncomingAsset (c , toAdd , ns )
@@ -1323,7 +1323,7 @@ func parseIncomingAsset(c context.Context, newAsset dashapi.NewAsset, ns string)
13231323 }, nil
13241324}
13251325
1326- func apiNeededAssetsList (c context.Context , req * any ) (interface {} , error ) {
1326+ func apiNeededAssetsList (c context.Context , req * any ) (any , error ) {
13271327 return queryNeededAssets (c )
13281328}
13291329
@@ -1704,7 +1704,7 @@ func handleRefreshSubsystems(w http.ResponseWriter, r *http.Request) {
17041704 }
17051705}
17061706
1707- func apiSaveDiscussion (c context.Context , req * dashapi.SaveDiscussionReq ) (interface {} , error ) {
1707+ func apiSaveDiscussion (c context.Context , req * dashapi.SaveDiscussionReq ) (any , error ) {
17081708 d := req .Discussion
17091709 newBugIDs := []string {}
17101710 for _ , id := range d .BugIDs {
@@ -1743,7 +1743,7 @@ func recordEmergencyStop(c context.Context) error {
17431743// Share crash logs for non-reproduced bugs with syz-managers.
17441744// In future, this can also take care of repro exchange between instances
17451745// in the place of syz-hub.
1746- func apiLogToReproduce (c context.Context , ns string , req * dashapi.LogToReproReq ) (interface {} , error ) {
1746+ func apiLogToReproduce (c context.Context , ns string , req * dashapi.LogToReproReq ) (any , error ) {
17471747 build , err := loadBuild (c , ns , req .BuildID )
17481748 if err != nil {
17491749 return nil , err
@@ -1863,15 +1863,15 @@ func takeReproTask(c context.Context, ns, manager string) ([]byte, error) {
18631863 return log , err
18641864}
18651865
1866- func apiCreateUploadURL (c context.Context , req * any ) (interface {} , error ) {
1866+ func apiCreateUploadURL (c context.Context , req * any ) (any , error ) {
18671867 bucket := getConfig (c ).UploadBucket
18681868 if bucket == "" {
18691869 return nil , errors .New ("not configured" )
18701870 }
18711871 return fmt .Sprintf ("%s/%s.upload" , bucket , uuid .New ().String ()), nil
18721872}
18731873
1874- func apiSendEmail (c context.Context , req * dashapi.SendEmailReq ) (interface {} , error ) {
1874+ func apiSendEmail (c context.Context , req * dashapi.SendEmailReq ) (any , error ) {
18751875 var headers mail.Header
18761876 if req .InReplyTo != "" {
18771877 headers = mail.Header {"In-Reply-To" : []string {req .InReplyTo }}
@@ -1889,7 +1889,7 @@ func apiSendEmail(c context.Context, req *dashapi.SendEmailReq) (interface{}, er
18891889// apiSaveCoverage reads jsonl data from payload and stores it to coveragedb.
18901890// First payload jsonl line is a coveragedb.HistoryRecord (w/o session and time).
18911891// Second+ records are coveragedb.JSONLWrapper.
1892- func apiSaveCoverage (c context.Context , payload io.Reader ) (interface {} , error ) {
1892+ func apiSaveCoverage (c context.Context , payload io.Reader ) (any , error ) {
18931893 descr := new (coveragedb.HistoryRecord )
18941894 jsonDec := json .NewDecoder (payload )
18951895 if err := jsonDec .Decode (descr ); err != nil {
0 commit comments