Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
a6be1d0d
Commit
a6be1d0d
authored
Jun 14, 2019
by
John Luxford
Committed by
Robert Winslow
Jun 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Go] Fix namespaces on enums (#5406)
parent
a7e20b19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
idl_gen_go.cpp
src/idl_gen_go.cpp
+1
-1
TableInFirstNS.go
tests/namespace_test/NamespaceA/TableInFirstNS.go
+4
-4
No files found.
src/idl_gen_go.cpp
View file @
a6be1d0d
...
...
@@ -143,7 +143,7 @@ class GoGenerator : public BaseGenerator {
// Construct the name of the type for this enum.
std
::
string
GetEnumTypeName
(
const
EnumDef
&
enum_def
)
{
return
WrapInNameSpaceAndTrack
(
cur_name_space_
,
GoIdentity
(
enum_def
.
name
));
return
WrapInNameSpaceAndTrack
(
enum_def
.
defined_namespace
,
GoIdentity
(
enum_def
.
name
));
}
// Create a type for the enum values.
...
...
tests/namespace_test/NamespaceA/TableInFirstNS.go
View file @
a6be1d0d
...
...
@@ -41,15 +41,15 @@ func (rcv *TableInFirstNS) FooTable(obj *NamespaceA__NamespaceB.TableInNestedNS)
return
nil
}
func
(
rcv
*
TableInFirstNS
)
FooEnum
()
EnumInNestedNS
{
func
(
rcv
*
TableInFirstNS
)
FooEnum
()
NamespaceA__NamespaceB
.
EnumInNestedNS
{
o
:=
flatbuffers
.
UOffsetT
(
rcv
.
_tab
.
Offset
(
6
))
if
o
!=
0
{
return
EnumInNestedNS
(
rcv
.
_tab
.
GetInt8
(
o
+
rcv
.
_tab
.
Pos
))
return
NamespaceA__NamespaceB
.
EnumInNestedNS
(
rcv
.
_tab
.
GetInt8
(
o
+
rcv
.
_tab
.
Pos
))
}
return
0
}
func
(
rcv
*
TableInFirstNS
)
MutateFooEnum
(
n
EnumInNestedNS
)
bool
{
func
(
rcv
*
TableInFirstNS
)
MutateFooEnum
(
n
NamespaceA__NamespaceB
.
EnumInNestedNS
)
bool
{
return
rcv
.
_tab
.
MutateInt8Slot
(
6
,
int8
(
n
))
}
...
...
@@ -72,7 +72,7 @@ func TableInFirstNSStart(builder *flatbuffers.Builder) {
func
TableInFirstNSAddFooTable
(
builder
*
flatbuffers
.
Builder
,
fooTable
flatbuffers
.
UOffsetT
)
{
builder
.
PrependUOffsetTSlot
(
0
,
flatbuffers
.
UOffsetT
(
fooTable
),
0
)
}
func
TableInFirstNSAddFooEnum
(
builder
*
flatbuffers
.
Builder
,
fooEnum
EnumInNestedNS
)
{
func
TableInFirstNSAddFooEnum
(
builder
*
flatbuffers
.
Builder
,
fooEnum
NamespaceA__NamespaceB
.
EnumInNestedNS
)
{
builder
.
PrependInt8Slot
(
1
,
int8
(
fooEnum
),
0
)
}
func
TableInFirstNSAddFooStruct
(
builder
*
flatbuffers
.
Builder
,
fooStruct
flatbuffers
.
UOffsetT
)
{
...
...
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