Skip to content

Commit abca05e

Browse files
committed
Merge pull request opencontainers#317 from wking/no-pointers-for-slices-or-maps
style: Document recent Go-pointer exceptions
2 parents b6d9ebf + d715acf commit abca05e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

style.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ The redundancy reduction from removing the namespacing prefix is not useful enou
1313
## Optional settings should have pointer Go types
1414

1515
So we have a consistent way to identify unset values ([source][optional-pointer]).
16+
The exceptions are entries where the Go default for the type is a no-op in the spec, in which case `omitempty` is sufficient and no pointer is needed (sources [here][no-pointer-for-slices], [here][no-pointer-for-boolean], and [here][pointer-when-updates-require-changes]).
17+
1618

1719
[capabilities]: config-linux.md#capabilities
1820
[class-id]: config-linux.md#network
1921
[integer-over-hex]: https://github.com/opencontainers/specs/pull/267#discussion_r48360013
2022
[keep-prefix]: https://github.com/opencontainers/specs/pull/159#issuecomment-138728337
23+
[no-pointer-for-boolean]: https://github.com/opencontainers/specs/pull/290#discussion_r50296396
24+
[no-pointer-for-slices]: https://github.com/opencontainers/specs/pull/316/files#r50782982
2125
[optional-pointer]: https://github.com/opencontainers/specs/pull/233#discussion_r47829711
26+
[pointer-when-updates-require-changes]: https://github.com/opencontainers/specs/pull/317/files#r50932706

0 commit comments

Comments
 (0)