Commit 60b83df
committed
style: Document recent Go-pointer exceptions
The general rule seems to be:
If Go's default value has the same semantics we'd use for an unset
value, don't bother with a pointer.
I'm not sure how well that squares with [1]:
We want a consistent way to identify unset settings.
But if the falsy values count as "unset", maybe the "null is a
consistent identifier for unset" approach was never really viable.
I'm also not sure if the new style extends to integers where zero has
the same semantics as unset values. It sounds like Michael was ok
with no pointers for those values [2], but OOMScoreAdj (where zero
clearly means "do nothing") got a pointer in #233 [3]. More clarity
on the threshold would be nice.
[1]: #233 (comment)
[2]: #233 (comment)
[3]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206
Signed-off-by: W. Trevor King <[email protected]>1 parent a7b5092 commit 60b83df
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
0 commit comments