Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a NULL tags property to be nil when read from the database #44

Merged
merged 1 commit into from
Nov 20, 2023

Commits on Nov 20, 2023

  1. Allow a NULL tags property to be nil when read from the database

    This one's so tiny that it's minutiae, but as I was looking at the
    null-ability of various job row fields today while implementing Ruby, I
    realized that it doesn't really seem necessary to be marshaling a `NULL`
    tags value to an empty `[]string{}` slice. In Go, `[]string{}` and
    `[]string(nil)` are functionally identical in every way that I can think
    of (`append` on `nil` works, `len` on `nil` works), so I think it makes
    sense just to avoid the allocation and reflect what the database's
    actual value is.
    
    [1] https://go.dev/tour/moretypes/15
    brandur committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    b188145 View commit details
    Browse the repository at this point in the history