Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scc-net
netvs
api-generator
Commits
18e5b255
Verified
Commit
18e5b255
authored
7 months ago
by
Janis Streib
Browse files
Options
Downloads
Patches
Plain Diff
UPD: goalng: make package optional
parent
1c813f1b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net_api_generator/generator.py
+3
-2
3 additions, 2 deletions
net_api_generator/generator.py
with
3 additions
and
2 deletions
net_api_generator/generator.py
+
3
−
2
View file @
18e5b255
...
...
@@ -383,7 +383,7 @@ def ta_schema():
@cli.command
()
@click.option
(
'
--package
'
,
help
=
'
GOLang Package name
'
)
@click.option
(
'
--package
'
,
help
=
'
GOLang Package name
'
,
default
=
None
)
def
golang_structs
(
package
):
def
netdb_datatype_to_go_ptr
(
a
):
if
a
.
is_nullable
:
...
...
@@ -443,7 +443,8 @@ def golang_structs(package):
print
(
f
'
Unknown datatype
"
{
n
[
"
name
"
]
}
"
(def:
{
n
}
)! Exiting.
'
,
file
=
sys
.
stderr
)
exit
(
1
)
print
(
f
"
package
{
package
}
\n
"
)
if
package
is
not
None
:
print
(
f
"
package
{
package
}
\n
"
)
print
(
'
import
"
net
"
\n
'
)
for
o
in
loader
.
api_objects
.
values
():
cap_fq
=
''
.
join
([
t
[
0
].
upper
()
+
t
[
1
:]
if
len
(
t
)
>=
2
else
t
for
t
in
o
.
fq_name
.
split
(
'
.
'
)])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment