8000 Detect optional db struct · Issue #405 · uber-go/nilaway · GitHub
[go: up one dir, main page]

Skip to content

Detect optional db struct #405

Open
Open

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

Activity

  1. sonalmahajan15 commented on May 27, 2026

    @sonalmahajan15
    Collaborator

    @tchaton tracking of struct pointer fields is currently not enabled by default in NilAway, since it can incur a significant performance overhead. You can turn on the flag experimental-struct-init to enable this tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned< 42C4 /span>

    Labels

    feature structinitRequires struct initialization support

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0