Skip to content

False positive - cgo - block starting/ending with whitespaces #162

Open
@RickvanLoo

Description

For the newest wsl (v4.5.0), given this code snippet:

// SetEventAlarm updates the EventAlarm settings.
func (e *Ecopoint) SetEventAlarm(alarm EventAlarm) error {
	ret := C.ecopointSetEventAlarm(
		e.instance,
		C.uint8_t(alarm.Count), C.uint8_t(alarm.BaseTime), C.uint8_t(alarm.LockTime), C.uint16_t(alarm.Threshold),
	)
	if ret != 0 {
		return getLastError()
	}

	return nil
}

I'm getting the following false positives:

ecopoint_clib.go:117:27: block should not start with a whitespace
ecopoint_clib.go:120:68: block should not end with a whitespace (or comment)

Pointing to the start and end of the ret block.

I'm still trying to isolate the issue, but I've not been able to produce it yet outside of our project.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions