Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
6647e47c
Commit
6647e47c
authored
Jan 19, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b6f9859c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
t/neo/protogen.go
t/neo/protogen.go
+4
-4
No files found.
t/neo/protogen.go
View file @
6647e47c
...
@@ -237,19 +237,19 @@ func (d *decoder) genEpilogue() {
...
@@ -237,19 +237,19 @@ func (d *decoder) genEpilogue() {
d
.
emit
(
"}
\n
"
)
d
.
emit
(
"}
\n
"
)
}
}
func
(
/*e*/
d
*
encoder
)
genBasic
(
path
string
,
typ
*
types
.
Basic
,
userType
types
.
Type
,
obj
types
.
Object
)
{
func
(
e
*
encoder
)
genBasic
(
path
string
,
typ
*
types
.
Basic
,
userType
types
.
Type
,
obj
types
.
Object
)
{
basic
:=
basicTypes
[
typ
.
Kind
()]
basic
:=
basicTypes
[
typ
.
Kind
()]
dataptr
:=
fmt
.
Sprintf
(
"data[%v:]"
,
d
.
n
)
dataptr
:=
fmt
.
Sprintf
(
"data[%v:]"
,
e
.
n
)
if
userType
!=
nil
&&
userType
!=
typ
{
if
userType
!=
nil
&&
userType
!=
typ
{
// userType is a named type over some basic, like
// userType is a named type over some basic, like
// type ClusterState int32
// type ClusterState int32
// -> need to cast
// -> need to cast
path
=
fmt
.
Sprintf
(
"%v(%v)"
,
typeName
(
typ
),
path
)
path
=
fmt
.
Sprintf
(
"%v(%v)"
,
typeName
(
typ
),
path
)
}
}
d
.
n
+=
basic
.
wireSize
e
.
n
+=
basic
.
wireSize
// NOTE no space before "=" - to be able to merge with ":"
// NOTE no space before "=" - to be able to merge with ":"
// prefix and become defining assignment
// prefix and become defining assignment
d
.
emit
(
basic
.
encode
,
dataptr
,
path
)
e
.
emit
(
basic
.
encode
,
dataptr
,
path
)
}
}
func
(
d
*
decoder
)
genBasic
(
assignto
string
,
typ
*
types
.
Basic
,
userType
types
.
Type
,
obj
types
.
Object
)
{
func
(
d
*
decoder
)
genBasic
(
assignto
string
,
typ
*
types
.
Basic
,
userType
types
.
Type
,
obj
types
.
Object
)
{
...
...
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