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

Panic: xsd: unexpected xsd.Type <nil> <nil> passed to XMLName #6

Closed
ghost opened this issue Jan 21, 2017 · 2 comments
Closed

Panic: xsd: unexpected xsd.Type <nil> <nil> passed to XMLName #6

ghost opened this issue Jan 21, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 21, 2017

I try to generate structs for this xsd with this command xsdgen -o schema.go -pkg types -vv Types.xsd and get panic:

*xsd.SimpleType(ordinalNumberText) -> xsd.Builtin(string)
panic: xsd: unexpected xsd.Type <nil> <nil> passed to XMLName

goroutine 1 [running]:
panic(0x1e03a0, 0xc420554c20)
        /usr/local/Cellar/go/1.7.4_2/libexec/src/runtime/panic.go:500 +0x1a1
aqwari.net/xml/xsd.XMLName(0x0, 0x0, 0xc4200715f0, 0x23, 0xc4203daf80, 0x14)
        ./vendor/src/aqwari.net/xml/xsd/xsd.go:290 +0x240
aqwari.net/xml/xsdgen.(*Config).flatten1(0xc4200dc480, 0x3793c0, 0xc420130480, 0xc4205bd128, 0x1, 0xc420588230)
        ./vendor/src/aqwari.net/xml/xsdgen/xsdgen.go:344 +0x358
aqwari.net/xml/xsdgen.(*Config).flatten1(0xc4200dc480, 0x3793c0, 0xc42013e300, 0xc4205bd128, 0x3, 0x3)
        ./vendor/src/aqwari.net/xml/xsdgen/xsdgen.go:332 +0x200
aqwari.net/xml/xsdgen.(*Config).flatten1(0xc4200dc480, 0x3793c0, 0xc4203bb980, 0xc4205bd128, 0x2, 0x2)
        ./vendor/src/aqwari.net/xml/xsdgen/xsdgen.go:332 +0x200
aqwari.net/xml/xsdgen.(*Config).flatten(0xc4200dc480, 0xc4200d15c0, 0x27, 0xc420554840, 0x1)
        ./vendor/src/aqwari.net/xml/xsdgen/xsdgen.go:236 +0x286
aqwari.net/xml/xsdgen.(*Config).gen(0xc4200dc480, 0xc4203fc7e0, 0x1, 0x1, 0xc420556000, 0x5, 0x8, 0x0, 0x30, 0x34848efe00075a08)
        ./vendor/src/aqwari.net/xml/xsdgen/xsdgen.go:147 +0x6cf
aqwari.net/xml/xsdgen.(*Config).GenCode(0xc4200dc480, 0xc4200d6e80, 0x1, 0x1, 0x1, 0x1, 0x0)
        ./vendor/src/aqwari.net/xml/xsdgen/cli.go:41 +0x49b
doroginin added a commit to doroginin/go-xml that referenced this issue Jan 21, 2017
doroginin added a commit to doroginin/go-xml that referenced this issue Jan 21, 2017
droyo added a commit that referenced this issue Jan 21, 2017
[#6] Fix panic for simple types

This is great. With two lines of code you've eliminated two redundant checks.
@droyo
Copy link
Owner

droyo commented Jan 21, 2017

@rilinor 's PR has fixed the issue. However, I want to add a test case for this before I close it.

droyo added a commit that referenced this issue Jan 21, 2017
droyo added a commit that referenced this issue Jan 21, 2017
droyo added a commit that referenced this issue Jan 21, 2017
@droyo
Copy link
Owner

droyo commented Jan 21, 2017

Fixed and test case is in place so I won't make the same mistake again. Thanks @rilinor and @dd-akd

@droyo droyo closed this as completed Jan 21, 2017
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

No branches or pull requests

1 participant