Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip cgo package #662

Merged
merged 9 commits into from Apr 16, 2020
Merged

Skip cgo package #662

merged 9 commits into from Apr 16, 2020

Conversation

maitredede
Copy link
Contributor

Describe the PR
Swag tries to parse CGO packages, this PR adds a way to handle this.

Relation issue
#567

@codecov-io
Copy link

codecov-io commented Apr 8, 2020

Codecov Report

Merging #662 into master will decrease coverage by 0.09%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #662      +/-   ##
==========================================
- Coverage   85.00%   84.90%   -0.10%     
==========================================
  Files           7        7              
  Lines        1807     1809       +2     
==========================================
  Hits         1536     1536              
- Misses        172      173       +1     
- Partials       99      100       +1     
Impacted Files Coverage Δ
parser.go 79.62% <0.00%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc90151...070af50. Read the comment docs.

ghost
ghost previously approved these changes Apr 9, 2020
@ubogdan
Copy link
Contributor

ubogdan commented Apr 9, 2020

Can you please add some tests for it.
Thanks.

@maitredede
Copy link
Contributor Author

Hi,
I have added the unit test. Without the code in parser.go it fails. With the code in parser.go it passes.

brotherbin
brotherbin previously approved these changes Apr 14, 2020
Copy link

@brotherbin brotherbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had make the same change then fix the following issue
#674

@ubogdan
Copy link
Contributor

ubogdan commented Apr 14, 2020

As far as I understand from the fix, we are not interested in any struct declarations inside CGO packages?

@sdghchj
Copy link
Member

sdghchj commented Apr 14, 2020

So big a sample just for cgo?

@maitredede
Copy link
Contributor Author

As far as I understand from the fix, we are not interested in any struct declarations inside CGO packages?

Yes, I think would be too much problems to scan "cgo"... I think the purpose of cgo is only to use non-go libraries, not to expose directly native structs to json...

So big a sample just for cgo?

Copy/paste of simple ref example, just added some dummy cgo.

@sdghchj
Copy link
Member

sdghchj commented Apr 14, 2020

I mean can you compress it after you copy/paste it?

@maitredede
Copy link
Contributor Author

Hi,

I mean can you compress it after you copy/paste it?

What do you ben by "compress" ? Remove redundant files/code ? Or something more ? :)

@sdghchj
Copy link
Member

sdghchj commented Apr 16, 2020

Hi,

I mean can you compress it after you copy/paste it?

What do you ben by "compress" ? Remove redundant files/code ? Or something more ? :)

Remove redundant files/code.

@sdghchj
Copy link
Member

sdghchj commented Apr 16, 2020

Hi,

I mean can you compress it after you copy/paste it?

What do you ben by "compress" ? Remove redundant files/code ? Or something more ? :)

Just one gin router is enough. I think.

@maitredede
Copy link
Contributor Author

I think I have it :)

Copy link
Member

@sdghchj sdghchj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sdghchj sdghchj merged commit 86f9d9c into swaggo:master Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants