Inspectopedia
 
2024.3

'Unmarshal' is called with the incorrect argument

Warning
Reliability
New
Last modified: 03 December 2024

Reports calls to json.Unmarshal and similar functions if the argument that is passed to store the result is not a pointer or an interface.

These calls will fail and return an error.

For more information about Unmarshal, refer to func Unmarshal at go.dev.

Example:

After the Prepend '&' quick-fix is applied: