Skip to content

Files

Latest commit

 

History

History
30 lines (20 loc) · 516 Bytes

unusedstringmethods.md

File metadata and controls

30 lines (20 loc) · 516 Bytes

Pattern: Unused result of method of type func()

Issue: -

Description

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()
}

Further Reading