Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
54b6edc4
Commit
54b6edc4
authored
Mar 13, 2017
by
Andy Goldstein
Committed by
Andy Goldstein
Apr 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go-to-protobuf: actually skip - packages
If a package is prefixed with -, we are not supposed to be generating protobuf for it. Make that actually happen :-)
parent
4e172303
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
cmd.go
cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
+7
-0
No files found.
cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
View file @
54b6edc4
...
@@ -137,6 +137,7 @@ func Run(g *Generator) {
...
@@ -137,6 +137,7 @@ func Run(g *Generator) {
protobufNames
:=
NewProtobufNamer
()
protobufNames
:=
NewProtobufNamer
()
outputPackages
:=
generator
.
Packages
{}
outputPackages
:=
generator
.
Packages
{}
nonOutputPackages
:=
map
[
string
]
struct
{}{}
for
_
,
d
:=
range
strings
.
Split
(
g
.
Packages
,
","
)
{
for
_
,
d
:=
range
strings
.
Split
(
g
.
Packages
,
","
)
{
generateAllTypes
,
outputPackage
:=
true
,
true
generateAllTypes
,
outputPackage
:=
true
,
true
switch
{
switch
{
...
@@ -160,6 +161,8 @@ func Run(g *Generator) {
...
@@ -160,6 +161,8 @@ func Run(g *Generator) {
protobufNames
.
Add
(
p
)
protobufNames
.
Add
(
p
)
if
outputPackage
{
if
outputPackage
{
outputPackages
=
append
(
outputPackages
,
p
)
outputPackages
=
append
(
outputPackages
,
p
)
}
else
{
nonOutputPackages
[
name
]
=
struct
{}{}
}
}
}
}
...
@@ -198,6 +201,10 @@ func Run(g *Generator) {
...
@@ -198,6 +201,10 @@ func Run(g *Generator) {
var
vendoredOutputPackages
,
localOutputPackages
generator
.
Packages
var
vendoredOutputPackages
,
localOutputPackages
generator
.
Packages
for
_
,
p
:=
range
protobufNames
.
packages
{
for
_
,
p
:=
range
protobufNames
.
packages
{
if
_
,
ok
:=
nonOutputPackages
[
p
.
Name
()];
ok
{
// if we're not outputting the package, don't include it in either package list
continue
}
p
.
Vendored
=
strings
.
Contains
(
c
.
Universe
[
p
.
PackagePath
]
.
SourcePath
,
"/vendor/"
)
p
.
Vendored
=
strings
.
Contains
(
c
.
Universe
[
p
.
PackagePath
]
.
SourcePath
,
"/vendor/"
)
if
p
.
Vendored
{
if
p
.
Vendored
{
vendoredOutputPackages
=
append
(
vendoredOutputPackages
,
p
)
vendoredOutputPackages
=
append
(
vendoredOutputPackages
,
p
)
...
...
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