@@ -197,7 +197,7 @@ func (n *namingInfo) Syntax(basePkg *loader.Package, imports *importsList) strin
197
197
(& namingInfo {typeInfo : typeInfo .Key ()}).Syntax (basePkg , imports ),
198
198
(& namingInfo {typeInfo : typeInfo .Elem ()}).Syntax (basePkg , imports ))
199
199
default :
200
- basePkg .AddError (fmt .Errorf ("name requested for invalid type %s" , typeInfo ))
200
+ basePkg .AddError (fmt .Errorf ("name requested for invalid type: %s" , typeInfo ))
201
201
return typeInfo .String ()
202
202
}
203
203
}
@@ -215,7 +215,7 @@ type copyMethodMaker struct {
215
215
func (c * copyMethodMaker ) GenerateMethodsFor (root * loader.Package , info * markers.TypeInfo ) {
216
216
typeInfo := root .TypesInfo .TypeOf (info .RawSpec .Name )
217
217
if typeInfo == types .Typ [types .Invalid ] {
218
- root .AddError (loader .ErrFromNode (fmt .Errorf ("unknown type %s" , info .Name ), info .RawSpec ))
218
+ root .AddError (loader .ErrFromNode (fmt .Errorf ("unknown type: %s" , info .Name ), info .RawSpec ))
219
219
}
220
220
221
221
// figure out if we need to use a pointer receiver -- most types get a pointer receiver,
@@ -312,7 +312,7 @@ func (c *copyMethodMaker) genDeepCopyIntoBlock(actualName *namingInfo, typeInfo
312
312
// handled via the above loop, should never happen
313
313
c .pkg .AddError (fmt .Errorf ("interface type %s encountered directly, invalid condition" , last ))
314
314
default :
315
- c .pkg .AddError (fmt .Errorf ("invalid type %s" , last ))
315
+ c .pkg .AddError (fmt .Errorf ("invalid type: %s" , last ))
316
316
}
317
317
}
318
318
@@ -322,7 +322,7 @@ func (c *copyMethodMaker) genMapDeepCopy(actualName *namingInfo, mapType *types.
322
322
// maps *must* have shallow-copiable types, since we just iterate
323
323
// through the keys, only trying to deepcopy the values.
324
324
if ! fineToShallowCopy (mapType .Key ()) {
325
- c .pkg .AddError (fmt .Errorf ("invalid map key type %s" , mapType .Key ()))
325
+ c .pkg .AddError (fmt .Errorf ("invalid map key type: %s" , mapType .Key ()))
326
326
return
327
327
}
328
328
@@ -383,7 +383,7 @@ func (c *copyMethodMaker) genMapDeepCopy(actualName *namingInfo, mapType *types.
383
383
// structs will have deepcopy generated for them, so use that
384
384
c .Line ("(*out)[key] = *val.DeepCopy()" )
385
385
default :
386
- c .pkg .AddError (fmt .Errorf ("invalid map value type %s" , underlyingElem ))
386
+ c .pkg .AddError (fmt .Errorf ("invalid map value type: %s" , underlyingElem ))
387
387
return
388
388
}
389
389
}
@@ -425,7 +425,7 @@ func (c *copyMethodMaker) genSliceDeepCopy(actualName *namingInfo, sliceType *ty
425
425
// structs will always have deepcopy
426
426
c .Linef ("(*in)[i].DeepCopyInto(&(*out)[i])" )
427
427
default :
428
- c .pkg .AddError (fmt .Errorf ("invalid slice element type %s" , underlyingElem ))
428
+ c .pkg .AddError (fmt .Errorf ("invalid slice element type: %s" , underlyingElem ))
429
429
}
430
430
})
431
431
}
@@ -491,7 +491,7 @@ func (c *copyMethodMaker) genStructDeepCopy(_ *namingInfo, structType *types.Str
491
491
c .Linef ("in.%[1]s.DeepCopyInto(&out.%[1]s)" , field .Name ())
492
492
}
493
493
default :
494
- c .pkg .AddError (fmt .Errorf ("invalid field type %s" , underlyingField ))
494
+ c .pkg .AddError (fmt .Errorf ("invalid field type: %s" , underlyingField ))
495
495
return
496
496
}
497
497
}
@@ -542,7 +542,7 @@ func (c *copyMethodMaker) genPointerDeepCopy(_ *namingInfo, pointerType *types.P
542
542
c .Linef ("*out = new(%[1]s)" , (& namingInfo {typeInfo : pointerType .Elem ()}).Syntax (c .pkg , c .importsList ))
543
543
c .Line ("(*in).DeepCopyInto(*out)" )
544
544
default :
545
- c .pkg .AddError (fmt .Errorf ("invalid pointer element type %s" , underlyingElem ))
545
+ c .pkg .AddError (fmt .Errorf ("invalid pointer element type: %s" , underlyingElem ))
546
546
return
547
547
}
548
548
}
@@ -602,7 +602,7 @@ func shouldBeCopied(pkg *loader.Package, info *markers.TypeInfo) bool {
602
602
603
603
typeInfo := pkg .TypesInfo .TypeOf (info .RawSpec .Name )
604
604
if typeInfo == types .Typ [types .Invalid ] {
605
- pkg .AddError (loader .ErrFromNode (fmt .Errorf ("unknown type %s" , info .Name ), info .RawSpec ))
605
+ pkg .AddError (loader .ErrFromNode (fmt .Errorf ("unknown type: %s" , info .Name ), info .RawSpec ))
606
606
return false
607
607
}
608
608
0 commit comments