Closed davidmat50 closed 1 year ago
The library calls panicked when testing a yang file which refers to a prefix, , but module import with that prfix is missing.
panic stack:
goroutine 1 [running]: github.com/freeconf/yang/meta.findModuleAndIsExternal({0x101a170?, 0xc0001baa90?}, {0xc0004b60fc, 0x3}) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/util.go:73 +0xb4 github.com/freeconf/yang/meta.(*resolver).findGrouping(0x1f737f7f3f0?, 0xc0001baa90) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:532 +0x74 github.com/freeconf/yang/meta.(*resolver).addDataDef(0xc000099a60, {0x101b1d0, 0xc00021f320}, {0x101a170?, 0xc0001baa90?}) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:414 +0xd2 github.com/freeconf/yang/meta.(*resolver).dataDef(0xc00021f320?, {0x101b1d0, 0xc00021f320}, {0xc00051b400?, 0x2, 0xe01f?}) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:371 +0xaa github.com/freeconf/yang/meta.(*resolver).addDataDef(0xc000099a60, {0x101b240, 0xc000002f00}, {0x1019fb0?, 0xc00021f320?}) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:478 +0x429 github.com/freeconf/yang/meta.(*resolver).dataDef(0xc000204780?, {0x101b240, 0xc000002f00}, {0xc000516770?, 0x1, 0xcd0dc7?}) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:371 +0xaa github.com/freeconf/yang/meta.(*resolver).module(0xc00000a358?, 0xc000002f00) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:93 +0x233 github.com/freeconf/yang/meta.resolve(0x10?) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/resolver.go:25 +0x6a github.com/freeconf/yang/meta.Compile(0xc000002f00) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/meta/compile.go:18 +0x2c github.com/freeconf/yang/parser.LoadModuleWithOptions(0xc00051b380, {0xc00001e0e0, 0xa}, {{0x0?, 0x0?}, {0x0?, 0xc000099c60?}}) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/parser/loader.go:72 +0x1fd github.com/freeconf/yang/parser.LoadModule(...) C:/Users/dama0416/go/pkg/mod/github.com/freeconf/yang@v0.0.0-20230710114243-bc7f6c1082ad/parser/loader.go:16 . . .
File used:
module panic-case { yang-version "1.1"; namespace "urn:params:panic-case"; prefix panic-case; /*import module_for_import { prefix imp; }*/ container customer { leaf simple-leaf { type string; } uses imp:grouping-test; } }
fixed
The library calls panicked when testing a yang file which refers to a prefix, , but module import with that prfix is missing.
panic stack:
File used: