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

style: Document recent Go-pointer exceptions #317

Merged

Commits on Jan 27, 2016

  1. 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.
    
    Qiang points out that pointers are required to opt-out of boolean
    settings where both true and false would require action [2], so I've
    worded the exception to only apply when the Go default for the type is
    expicitly a no-op in the spec.
    
    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 [3], but OOMScoreAdj (where zero
    clearly means "do nothing") got a pointer in opencontainers#233 [4].  More clarity
    on the threshold would be nice; in this commit I've laid out the logic
    and not explicitly listed the types it applies to.
    
    [1]: opencontainers#233 (comment)
    [2]: https://github.com/opencontainers/specs/pull/317/files#r50932706
    [3]: opencontainers#233 (comment)
    [4]: https://github.com/opencontainers/specs/pull/233/files#diff-34c30be66233f08b447fb608ea0e66bbR206
    
    Signed-off-by: W. Trevor King <wking@tremily.us>
    wking committed Jan 27, 2016
    Configuration menu
    Copy the full SHA
    d715acf View commit details
    Browse the repository at this point in the history