Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
369a974b
Commit
369a974b
authored
Oct 31, 2012
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: slight wording change to remove a formal contradiction
Fixes #4324. R=r CC=golang-dev
https://golang.org/cl/6822062
parent
5176481f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
doc/go_spec.html
doc/go_spec.html
+3
-3
No files found.
doc/go_spec.html
View file @
369a974b
...
@@ -2128,18 +2128,18 @@ For struct literals the following rules apply:
...
@@ -2128,18 +2128,18 @@ For struct literals the following rules apply:
<ul>
<ul>
<li>
A key must be a field name declared in the LiteralType.
<li>
A key must be a field name declared in the LiteralType.
</li>
</li>
<li>
A
literal
that does not contain any keys must
<li>
A
n element list
that does not contain any keys must
list an element for each struct field in the
list an element for each struct field in the
order in which the fields are declared.
order in which the fields are declared.
</li>
</li>
<li>
If any element has a key, every element must have a key.
<li>
If any element has a key, every element must have a key.
</li>
</li>
<li>
A
literal
that contains keys does not need to
<li>
A
n element list
that contains keys does not need to
have an element for each struct field. Omitted fields
have an element for each struct field. Omitted fields
get the zero value for that field.
get the zero value for that field.
</li>
</li>
<li>
A literal may omit the element list; such a literal evaluates
<li>
A literal may omit the element list; such a literal evaluates
to the zero value for its type.
to the zero value for its type.
</li>
</li>
<li>
It is an error to specify an element for a non-exported
<li>
It is an error to specify an element for a non-exported
field of a struct belonging to a different package.
field of a struct belonging to a different package.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment