@@ -534,9 +534,9 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
534534 return & cmderrors.InvalidInstanceError {}
535535 }
536536
537- report := func (indexURL * url. URL , status rpc.IndexUpdateReport_Status ) * rpc.IndexUpdateReport {
537+ report := func (indexURL string , status rpc.IndexUpdateReport_Status ) * rpc.IndexUpdateReport {
538538 return & rpc.IndexUpdateReport {
539- IndexUrl : indexURL . String () ,
539+ IndexUrl : indexURL ,
540540 Status : status ,
541541 }
542542 }
@@ -564,7 +564,7 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
564564 downloadCB .Start (u , i18n .Tr ("Downloading index: %s" , u ))
565565 downloadCB .End (false , msg )
566566 failed = true
567- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_FAILED ))
567+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_FAILED ))
568568 continue
569569 }
570570
@@ -582,9 +582,9 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
582582 downloadCB .Start (u , i18n .Tr ("Downloading index: %s" , filepath .Base (URL .Path )))
583583 downloadCB .End (false , msg )
584584 failed = true
585- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_FAILED ))
585+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_FAILED ))
586586 } else {
587- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_SKIPPED ))
587+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_SKIPPED ))
588588 }
589589 continue
590590 }
@@ -596,14 +596,14 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
596596 downloadCB .Start (u , i18n .Tr ("Downloading index: %s" , filepath .Base (URL .Path )))
597597 downloadCB .End (false , i18n .Tr ("Invalid index URL: %s" , err ))
598598 failed = true
599- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_FAILED ))
599+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_FAILED ))
600600 continue
601601 }
602602 indexFile := indexpath .Join (indexFileName )
603603 if info , err := indexFile .Stat (); err == nil {
604604 ageSecs := int64 (time .Since (info .ModTime ()).Seconds ())
605605 if ageSecs < req .GetUpdateIfOlderThanSecs () {
606- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_ALREADY_UP_TO_DATE ))
606+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_ALREADY_UP_TO_DATE ))
607607 continue
608608 }
609609 }
@@ -622,9 +622,9 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
622622 }
623623 if err := indexResource .Download (stream .Context (), indexpath , downloadCB , config ); err != nil {
624624 failed = true
625- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_FAILED ))
625+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_FAILED ))
626626 } else {
627- result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (URL , rpc .IndexUpdateReport_STATUS_UPDATED ))
627+ result .UpdatedIndexes = append (result .GetUpdatedIndexes (), report (u , rpc .IndexUpdateReport_STATUS_UPDATED ))
628628 }
629629 }
630630 syncSend .Send (& rpc.UpdateIndexResponse {
0 commit comments