You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SA1026: false positive for nil pointer to struct containing unsupported type #1712
The problem is that our analysis is type-based, but you can marshal a *http.Request as long as it is nil, because the encoder won't recurse into it to find the field of unsupported type.
I don't think we can avoid this false positive in the general case (with non-trivial data flow) without neutering the check a fair bit.
changed the title [-]SA1026: false positive for fields in embedded struct that are overridden[/-][+]SA1026: false positive for nil pointer to struct containing unsupported type[/+]on May 2, 2026
Activity
dominikh commentedon May 2, 2026
Not embedding related, this is a simpler reproducer:
The problem is that our analysis is type-based, but you can marshal a
*http.Requestas long as it is nil, because the encoder won't recurse into it to find the field of unsupported type.I don't think we can avoid this false positive in the general case (with non-trivial data flow) without neutering the check a fair bit.
[-]SA1026: false positive for fields in embedded struct that are overridden[/-][+]SA1026: false positive for nil pointer to struct containing unsupported type[/+]