Go

Go

By DeepSource

Pure function's return value is discarded, making the call pointlessSCC-SA4017

Anti-pattern
Has Autofix

Return value of a pure function value should always be handled else calling the function is pointless. In case the return value is not required, it is recommended to remove the function call.

Examples

Bad practice

strings.Replace("", "", "", 1) // return value is discarded
f := foo(1)

Recommended

f := foo(1)