Skip to content

Detect optional db struct #405

@tchaton

Description

@tchaton

I tried nilaway over a piece of code that recentely had a panic.

// definition
type Event struct {
     ...
	Indexes *Indexes `gorm:"embedded;embeddedPrefix:indexes_"`
}

In another file

// Indexes was nil

event.Indexes.Anything

nilaway didn't detect this while It seemed quite an obvious panic risk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions