mirror of
https://github.com/golang/go
synced 2024-11-17 23:34:52 -07:00
cmd/compile: rename retsigerr to sigerr
retsigerr was used to create error message for both wrong function arguments and return arguments, so change its name to sigerr to reflect that. While at it, also add documentation for the wrong function arguments case. Passes toolstash-check. Change-Id: I740c717ad38d4afab9e8c20f2e94579c8bca67ff Reviewed-on: https://go-review.googlesource.com/c/go/+/255240 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
ddd35f8d71
commit
4ffc2bc533
@ -2711,7 +2711,7 @@ func errorDetails(nl Nodes, tstruct *types.Type, isddd bool) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("\n\thave %s\n\twant %v", nl.retsigerr(isddd), tstruct)
|
return fmt.Sprintf("\n\thave %s\n\twant %v", nl.sigerr(isddd), tstruct)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sigrepr is a type's representation to the outside world,
|
// sigrepr is a type's representation to the outside world,
|
||||||
@ -2735,9 +2735,8 @@ func sigrepr(t *types.Type) string {
|
|||||||
return t.String()
|
return t.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// retsigerr returns the signature of the types
|
// sigerr returns the signature of the types at the call or return.
|
||||||
// at the respective return call site of a function.
|
func (nl Nodes) sigerr(isddd bool) string {
|
||||||
func (nl Nodes) retsigerr(isddd bool) string {
|
|
||||||
if nl.Len() < 1 {
|
if nl.Len() < 1 {
|
||||||
return "()"
|
return "()"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user