Skip to content

Handling nil valuers.#260

Open
ilmaruk wants to merge 1 commit intogocraft:masterfrom
ilmaruk:bugfix/handle-nil-valuers
Open

Handling nil valuers.#260
ilmaruk wants to merge 1 commit intogocraft:masterfrom
ilmaruk:bugfix/handle-nil-valuers

Conversation

@ilmaruk
Copy link
Copy Markdown

@ilmaruk ilmaruk commented Oct 4, 2023

I took the liberty of creating this PR, because we're having troubles with nil pointers to types that implement driver.Valuer. In out case it's uuid.UUID, where:

func Foo(ctx context.Context, runner dbr.SessionRunner, id *uuid.UUID) error {
    stmt := runner.InsertInto(table).Pair("id", id)
}

would panic if id is nil.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant