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
6ccca615
Commit
6ccca615
authored
Dec 18, 2008
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- receiver ident may be optional
R=r DELTA=5 (2 added, 0 deleted, 3 changed) OCL=21508 CL=21510
parent
ab0d2582
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
doc/go_spec.txt
doc/go_spec.txt
+5
-3
No files found.
doc/go_spec.txt
View file @
6ccca615
...
...
@@ -3,7 +3,7 @@ The Go Programming Language Specification (DRAFT)
Robert Griesemer, Rob Pike, Ken Thompson
(December 1
7
, 2008)
(December 1
8
, 2008)
----
...
...
@@ -3045,10 +3045,12 @@ as a type name, or as a pointer to a type name. The type specified by the
type name is called ``receiver base type''. The receiver base type must be a
type declared in the current file, and it must not be a pointer type.
The method is said to be ``bound'' to the receiver base type; specifically
it is declared within the scope of that type (§Type declarations).
it is declared within the scope of that type (§Type declarations). If the
receiver value is not needed inside the method, its identifier may be omitted
in the declaration.
MethodDecl = "func" Receiver identifier FunctionType [ Block ] .
Receiver = "("
identifier
[ "*" ] TypeName ")" .
Receiver = "("
[ identifier ]
[ "*" ] TypeName ")" .
All methods bound to a receiver base type must have the same receiver type:
Either all receiver types are pointers to the base type or they are the base
...
...
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