Pattern: Unused result of method of type func()
Issue: -
This rule enforces to use return value of call to Error
and String
methods.
Example of incorrect code:
func _() {
var buf bytes.Buffer
buf.String() // result of bytes.Buffer.String call not used
}
Example of correct code:
func _() {
var buf bytes.Buffer
result = buf.String()
}