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
44a8642a
Commit
44a8642a
authored
Sep 08, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b54a37a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
t/pkt.go
t/pkt.go
+1
-1
t/pktgen.go
t/pktgen.go
+14
-3
No files found.
t/pkt.go
View file @
44a8642a
...
...
@@ -7,6 +7,6 @@ type Header struct {
}
type
Notify
struct
{
//
Header
Header
Message
string
}
t/pktgen.go
View file @
44a8642a
// TODO text what it does (generates code for pkt.go)
// +build ignore
package
main
import
(
...
...
@@ -20,7 +24,9 @@ func main() {
ncode
:=
0
//ast.Print(fset, f)
// ast.Print(fset, f)
// return
for
_
,
decl
:=
range
f
.
Decls
{
// we look for types (which can be only under GenDecl)
gdecl
,
ok
:=
decl
.
(
*
ast
.
GenDecl
)
...
...
@@ -57,8 +63,13 @@ func main() {
panic
(
fmt
.
Sprintf
(
"%#v not supported"
,
fieldv
.
Type
))
}
for
_
,
field
:=
range
fieldv
.
Names
{
fmt
.
Printf
(
"%s(%d).%s
\t
%s
\n
"
,
tname
,
ncode
,
field
.
Name
,
ftype
)
if
len
(
fieldv
.
Names
)
!=
0
{
for
_
,
field
:=
range
fieldv
.
Names
{
fmt
.
Printf
(
"%s(%d).%s
\t
%s
\n
"
,
tname
,
ncode
,
field
.
Name
,
ftype
)
}
}
else
{
// no names means embedding
fmt
.
Printf
(
"%s(%d).<%s>
\n
"
,
tname
,
ncode
,
ftype
)
}
}
...
...
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