top | item 46965997

(no title)

_ikke_ | 19 days ago

My favorite from this release.

> The built-in new function, which creates a new variable, now allows its operand to be an expression, specifying the initial value of the variable.

So no need for separate helpers anymore to instantiate a pointer to a literal.

discuss

order

candiddevmike|19 days ago

Now if only the Go gods would grant us in line ternaries to avoid all of the overly verbose nil checks, I'd be more likely to use pointer values in structs. Right now they're big foot guns that the compiler won't catch (and AFAIK no linter will check if you did a nil check before accessing).

I have a tech debt TODO on my backlog to rationalize null usage (waiting on encoding/jsonv2) where I'll go through structs and better determine which properties should be null (or even empty) both from a JSON and DB perspective, especially with custom types in the mix. Hopefully reducing the amount of possible values the TS frontend needs to handle...