@@ -41,7 +41,7 @@ func Check(ctx context.Context, c *CheckConfig) (*Target, error) {
4141 defer cancel ()
4242
4343 if len (c .URLs ) == 0 {
44- return nil , errors .New ("invalid target URL is zero " )
44+ return nil , errors .New ("URL is required at least one " )
4545 }
4646
4747 infos , err := getMirrorInfos (ctx , c .URLs )
@@ -76,7 +76,7 @@ func getMirrorInfos(ctx context.Context, urls []string) ([]*mirrorInfo, error) {
7676 eg .Go (func () error {
7777 info , err := getMirrorInfo (ctx , url )
7878 if err != nil {
79- return err
79+ return errors . Wrap ( err , url )
8080 }
8181
8282 mu .Lock ()
@@ -102,17 +102,17 @@ type mirrorInfo struct {
102102func getMirrorInfo (ctx context.Context , url string ) (* mirrorInfo , error ) {
103103 req , err := http .NewRequest ("HEAD" , url , nil )
104104 if err != nil {
105- return nil , errors .Wrapf (err , "failed to make head request: %q" , url )
105+ return nil , errors .Wrap (err , "failed to make head request" )
106106 }
107107 req = req .WithContext (ctx )
108108
109109 resp , err := http .DefaultClient .Do (req )
110110 if err != nil {
111- return nil , errors .Wrapf (err , "failed to head request: %q" , url )
111+ return nil , errors .Wrap (err , "failed to head request" )
112112 }
113113
114114 if resp .Header .Get ("Accept-Ranges" ) != "bytes" {
115- return nil , errors .Errorf ("does not support range request: %q" , url )
115+ return nil , errors .New ("does not support range request" )
116116 }
117117
118118 if resp .ContentLength <= 0 {
0 commit comments