cl: remove Underlying() call to reject string type aliases in rewrites
Type aliases like `type T string` are no longer supported for -ldflags -X rewrites. Only direct *string types are now allowed. - Removed Underlying() call from isStringPtrType - Added TestRewriteIgnoresStringAlias test case Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: cpunion <8459+cpunion@users.noreply.github.com>
This commit is contained in:
@@ -151,7 +151,7 @@ func (p *context) isStringPtrType(typ types.Type) bool {
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
basic, ok := ptr.Elem().Underlying().(*types.Basic)
|
||||
basic, ok := ptr.Elem().(*types.Basic)
|
||||
return ok && basic.Kind() == types.String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user