D: [iurt_root_command] chroot warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend. Installing /home/iurt/rpmbuild/SRPMS/golang-github-clbanning-x2j-1.1-1.mga9.src.rpm Building target platforms: aarch64 Building for target aarch64 Executing(%prep): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.2vQJeo + umask 022 + cd /home/iurt/rpmbuild/BUILD + '[' 1 -eq 1 ']' + '[' 1 -eq 1 ']' + '[' 1 -eq 1 ']' + cd /home/iurt/rpmbuild/BUILD + rm -rf x2j-1.1 + /usr/bin/gzip -dc /home/iurt/rpmbuild/SOURCES/x2j-1.1.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd x2j-1.1 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + rm -fr /home/iurt/rpmbuild/BUILD/x2j-1.1/vendor + [[ ! -e /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/bin ]] + install -m 0755 -vd /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/bin install: creating directory '/home/iurt/rpmbuild/BUILD/x2j-1.1/_build' install: creating directory '/home/iurt/rpmbuild/BUILD/x2j-1.1/_build/bin' + export GOPATH=/home/iurt/rpmbuild/BUILD/x2j-1.1/_build:/usr/share/gocode + GOPATH=/home/iurt/rpmbuild/BUILD/x2j-1.1/_build:/usr/share/gocode + [[ ! -e /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning/x2j ]] ++ dirname /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning/x2j + install -m 0755 -vd /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning install: creating directory '/home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src' install: creating directory '/home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com' install: creating directory '/home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning' + ln -fs /home/iurt/rpmbuild/BUILD/x2j-1.1 /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning/x2j + cd /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning/x2j + echo 'Patch #0 (0001-Remove-redundant-newlines-in-Println-statement.patch):' Patch #0 (0001-Remove-redundant-newlines-in-Println-statement.patch): + /usr/bin/patch --no-backup-if-mismatch -f -p1 --fuzz=0 patching file examples/gonuts2.go patching file x2j_test.go patching file x2jpath_test.go + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.hsX36Z + umask 022 + cd /home/iurt/rpmbuild/BUILD + '[' 1 -eq 1 ']' + '[' /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 '!=' / ']' + rm -rf /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 ++ dirname /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 + mkdir -p /home/iurt/rpmbuild/BUILDROOT + mkdir /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 + cd x2j-1.1 + '[' 1 -eq 1 ']' + cd /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src/github.com/clbanning/x2j + IFS= + gosupfiles= + mapfile -t gosupfilesA + go-rpm-integration install -i github.com/clbanning/x2j -b /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/bin -s /home/iurt/rpmbuild/BUILD/x2j-1.1/_build -o golang-github-clbanning-x2j-devel.file-list -O /home/iurt/rpmbuild/BUILD/x2j-1.1 -V 1.1-1.mga9 -T 1.1 -p /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 -g /usr/share/gocode -r '.*example.*' Installing: github.com/clbanning/x2j realpath: go.mod: No such file or directory + IFS= +++ realpath -e --relative-base=. examples README +++ sort -u ++ listfiles_include='README examples' ++ echo 'README examples' + godocs='README examples' + [[ -n README examples ]] + IFS= + read -r f + echo %doc '"README"' + IFS= + read -r f + echo %doc '"examples"' + IFS= + read -r f + IFS= +++ realpath -e --relative-base=. LICENSE +++ sort -u ++ listfiles_include=LICENSE ++ echo LICENSE + golicenses=LICENSE + [[ -n LICENSE ]] + IFS= + read -r f + echo %license '"LICENSE"' + IFS= + read -r f + /usr/lib/rpm/check-buildroot + '[' -n '' ']' + /usr/share/spec-helper/clean_files + '[' -n '' ']' + /usr/share/spec-helper/compress_files .xz + '[' -n '' ']' + /usr/share/spec-helper/relink_symlinks + '[' -n '' ']' + /usr/share/spec-helper/clean_perl + '[' -n '' ']' + /usr/share/spec-helper/lib_symlinks + '[' -n '' ']' + /usr/share/spec-helper/gprintify + '[' -n '' ']' + /usr/share/spec-helper/fix_mo + '[' -n '' ']' + /usr/share/spec-helper/fix_pamd + '[' -n '' ']' + /usr/share/spec-helper/remove_info_dir + '[' -n '' ']' + /usr/share/spec-helper/fix_eol + '[' -n '' ']' + /usr/share/spec-helper/check_desktop_files + '[' -n '' ']' + /usr/share/spec-helper/check_elf_files + /usr/lib/rpm/brp-strip /usr/bin/strip + /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python3 1 0 + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/brp-remove-la-files + /usr/lib/rpm/redhat/brp-mangle-shebangs Executing(%check): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.m6pju7 + umask 022 + cd /home/iurt/rpmbuild/BUILD + cd x2j-1.1 + '[' 1 -eq 1 ']' + LDFLAGS=' -X github.com/clbanning/x2j/version.tag=1.1 -X github.com/clbanning/x2j/version=1.1' + GO_TEST_FLAGS='-buildmode pie -compiler gc' + GO_TEST_EXT_LD_FLAGS=' -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags ' + go-rpm-integration check -i github.com/clbanning/x2j -b /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/bin -s /home/iurt/rpmbuild/BUILD/x2j-1.1/_build -V 1.1-1.mga9 -T 1.1 -p /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 -g /usr/share/gocode -r '.*example.*' Testing in: /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/src PATH: /home/iurt/rpmbuild/BUILD/x2j-1.1/_build/bin:/usr/local/bin:/usr/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/home/iurt/.local/bin:/home/iurt/bin GOPATH: /home/iurt/rpmbuild/BUILD/x2j-1.1/_build:/usr/share/gocode GO111MODULE: off command: go test -buildmode pie -compiler gc -ldflags " -X github.com/clbanning/x2j/version.tag=1.1 -X github.com/clbanning/x2j/version=1.1 -extldflags ' -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags '" testing: github.com/clbanning/x2j github.com/clbanning/x2j TestGoofy ... MapToDoc: map[byteVal:[116 104 101 32 97 105 100 32 111 102 32 116 104 101 105 114 32 99 111 117 110 116 114 121] goofyVal:0x40001a4048 nilVal:<nil> xml:map[tag:map[-bool:true -one:1 -pi:3.1415962535] tagJR:map[-key:value]]] v: {"byteVal":"dGhlIGFpZCBvZiB0aGVpciBjb3VudHJ5","goofyVal":{"S":"Now is the time for","Sp":"all good men to come to"},"nilVal":null,"xml":{"tag":{"-bool":"true","-one":"1","-pi":"3.1415962535"},"tagJR":{"-key":"value"}}} TestGoofier ... MapToDoc: map[byteVal:[116 104 101 32 97 105 100 32 111 102 32 116 104 101 105 114 32 99 111 117 110 116 114 121] goofierVal:0x4000188960 goofyVal:0x40001a4048 nilVal:<nil> xml:map[tag:map[-bool:true -one:1 -pi:3.1415962535] tagJR:map[-key:value]]] v: {"byteVal":"dGhlIGFpZCBvZiB0aGVpciBjb3VudHJ5","goofierVal":{"G":{"S":"Now is the time for","Sp":"all good men to come to"},"B":"dGhlIHRyZWUgb2YgZnJlZWRvbSBtdXN0IHBlcmlvZGljYWxseSBiZQ==","N":null},"goofyVal":{"S":"Now is the time for","Sp":"all good men to come to"},"nilVal":null,"xml":{"tag":{"-bool":"true","-one":"1","-pi":"3.1415962535"},"tagJR":{"-key":"value"}}} ToTree - Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> entry : vars : foo : bar foo2 : hello : world ToMap - Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> entry : vars : foo :[string] bar foo2 : hello :[string] world ToJson - Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> json: {"entry":{"vars":{"foo":"bar","foo2":{"hello":"world"}}}} ToJsonIndent - Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> json: { "entry": { "vars": { "foo": "bar", "foo2": { "hello": "world" } } } } BulkParser (with error) - Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry><this><is>an</err><entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> phandler m: map[entry:map[vars:map[foo:bar foo2:map[hello:world]]]] ehandler err: XML syntax error on line 1: element <is> closed by </err> phandler m: map[entry:map[vars:map[foo:bar foo2:map[hello:world]]]] BulkParser (with error) - Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry><this><is>an</err><entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> phandlerj s: {"entry":{"vars":{"foo":"bar","foo2":{"hello":"world"}}}} ehandler err: XML syntax error on line 1: element <is> closed by </err> phandlerj s: {"entry":{"vars":{"foo":"bar","foo2":{"hello":"world"}}}} ================================ x2j_test.go ... =================== TestX2j ... XML doc: <msg mtype="alert" mpriority="1"> <text>help me!</text> <song title="A Long Time" author="Mayer Hawthorne"> <verses> <verse name="verse 1" no="1"> <line no="1">Henry was a renegade</line> <line no="2">Didn't like to play it safe</line> <line no="3">One component at a time</line> <line no="4">There's got to be a better way</line> <line no="5">Oh, people came from miles around</line> <line no="6">Searching for a steady job</line> <line no="7">Welcome to the Motor Town</line> <line no="8">Booming like an atom bomb</line> </verse> <verse name="verse 2" no="2"> <line no="1">Oh, Henry was the end of the story</line> <line no="2">Then everything went wrong</line> <line no="3">And we'll return it to its former glory</line> <line no="4">But it just takes so long</line> </verse> </verses> <chorus> <line no="1">It's going to take a long time</line> <line no="2">It's going to take it, but we'll make it one day</line> <line no="3">It's going to take a long time</line> <line no="4">It's going to take it, but we'll make it one day</line> </chorus> </song> </msg> DocToTree(): msg : -mtype : alert -mpriority : 1 text : help me! song : -title : A Long Time -author : Mayer Hawthorne verses : verse : -name : verse 1 -no : 1 line : -no : 1 #text : Henry was a renegade line : -no : 2 #text : Didn't like to play it safe line : -no : 3 #text : One component at a time line : -no : 4 #text : There's got to be a better way line : -no : 5 #text : Oh, people came from miles around line : -no : 6 #text : Searching for a steady job line : -no : 7 #text : Welcome to the Motor Town line : -no : 8 #text : Booming like an atom bomb verse : -name : verse 2 -no : 2 line : -no : 1 #text : Oh, Henry was the end of the story line : -no : 2 #text : Then everything went wrong line : -no : 3 #text : And we'll return it to its former glory line : -no : 4 #text : But it just takes so long chorus : line : -no : 1 #text : It's going to take a long time line : -no : 2 #text : It's going to take it, but we'll make it one day line : -no : 3 #text : It's going to take a long time line : -no : 4 #text : It's going to take it, but we'll make it one day treeToMap, recast==false: msg : song : -title :[string] A Long Time -author :[string] Mayer Hawthorne verses : verse :[[]interface{}] [item: 0] -name :[string] verse 1 -no :[string] 1 line :[[]interface{}] [item: 0] -no :[string] 1 #text :[string] Henry was a renegade [item: 1] -no :[string] 2 #text :[string] Didn't like to play it safe [item: 2] -no :[string] 3 #text :[string] One component at a time [item: 3] -no :[string] 4 #text :[string] There's got to be a better way [item: 4] -no :[string] 5 #text :[string] Oh, people came from miles around [item: 5] -no :[string] 6 #text :[string] Searching for a steady job [item: 6] -no :[string] 7 #text :[string] Welcome to the Motor Town [item: 7] -no :[string] 8 #text :[string] Booming like an atom bomb [item: 1] -name :[string] verse 2 -no :[string] 2 line :[[]interface{}] [item: 0] -no :[string] 1 #text :[string] Oh, Henry was the end of the story [item: 1] -no :[string] 2 #text :[string] Then everything went wrong [item: 2] -no :[string] 3 #text :[string] And we'll return it to its former glory [item: 3] -no :[string] 4 #text :[string] But it just takes so long chorus : line :[[]interface{}] [item: 0] -no :[string] 1 #text :[string] It's going to take a long time [item: 1] -no :[string] 2 #text :[string] It's going to take it, but we'll make it one day [item: 2] -no :[string] 3 #text :[string] It's going to take a long time [item: 3] -no :[string] 4 #text :[string] It's going to take it, but we'll make it one day -mtype :[string] alert -mpriority :[string] 1 text :[string] help me! json.MarshalIndent, recast==false: { "msg": { "-mpriority": "1", "-mtype": "alert", "song": { "-author": "Mayer Hawthorne", "-title": "A Long Time", "chorus": { "line": [ { "#text": "It's going to take a long time", "-no": "1" }, { "#text": "It's going to take it, but we'll make it one day", "-no": "2" }, { "#text": "It's going to take a long time", "-no": "3" }, { "#text": "It's going to take it, but we'll make it one day", "-no": "4" } ] }, "verses": { "verse": [ { "-name": "verse 1", "-no": "1", "line": [ { "#text": "Henry was a renegade", "-no": "1" }, { "#text": "Didn't like to play it safe", "-no": "2" }, { "#text": "One component at a time", "-no": "3" }, { "#text": "There's got to be a better way", "-no": "4" }, { "#text": "Oh, people came from miles around", "-no": "5" }, { "#text": "Searching for a steady job", "-no": "6" }, { "#text": "Welcome to the Motor Town", "-no": "7" }, { "#text": "Booming like an atom bomb", "-no": "8" } ] }, { "-name": "verse 2", "-no": "2", "line": [ { "#text": "Oh, Henry was the end of the story", "-no": "1" }, { "#text": "Then everything went wrong", "-no": "2" }, { "#text": "And we'll return it to its former glory", "-no": "3" }, { "#text": "But it just takes so long", "-no": "4" } ] } ] } }, "text": "help me!" } } DocToMap(), recast==true: msg : -mtype :[string] alert -mpriority :[float64] 1.00e+00 text :[string] help me! song : -title :[string] A Long Time -author :[string] Mayer Hawthorne verses : verse :[[]interface{}] [item: 0] -name :[string] verse 1 -no :[float64] 1.00e+00 line :[[]interface{}] [item: 0] -no :[float64] 1.00e+00 #text :[string] Henry was a renegade [item: 1] -no :[float64] 2.00e+00 #text :[string] Didn't like to play it safe [item: 2] -no :[float64] 3.00e+00 #text :[string] One component at a time [item: 3] -no :[float64] 4.00e+00 #text :[string] There's got to be a better way [item: 4] -no :[float64] 5.00e+00 #text :[string] Oh, people came from miles around [item: 5] -no :[float64] 6.00e+00 #text :[string] Searching for a steady job [item: 6] -no :[float64] 7.00e+00 #text :[string] Welcome to the Motor Town [item: 7] #text :[string] Booming like an atom bomb -no :[float64] 8.00e+00 [item: 1] line :[[]interface{}] [item: 0] #text :[string] Oh, Henry was the end of the story -no :[float64] 1.00e+00 [item: 1] -no :[float64] 2.00e+00 #text :[string] Then everything went wrong [item: 2] -no :[float64] 3.00e+00 #text :[string] And we'll return it to its former glory [item: 3] -no :[float64] 4.00e+00 #text :[string] But it just takes so long -name :[string] verse 2 -no :[float64] 2.00e+00 chorus : line :[[]interface{}] [item: 0] -no :[float64] 1.00e+00 #text :[string] It's going to take a long time [item: 1] #text :[string] It's going to take it, but we'll make it one day -no :[float64] 2.00e+00 [item: 2] -no :[float64] 3.00e+00 #text :[string] It's going to take a long time [item: 3] -no :[float64] 4.00e+00 #text :[string] It's going to take it, but we'll make it one day DocToJsonIndent, recast==true: { "msg": { "-mpriority": 1, "-mtype": "alert", "song": { "-author": "Mayer Hawthorne", "-title": "A Long Time", "chorus": { "line": [ { "#text": "It's going to take a long time", "-no": 1 }, { "#text": "It's going to take it, but we'll make it one day", "-no": 2 }, { "#text": "It's going to take a long time", "-no": 3 }, { "#text": "It's going to take it, but we'll make it one day", "-no": 4 } ] }, "verses": { "verse": [ { "-name": "verse 1", "-no": 1, "line": [ { "#text": "Henry was a renegade", "-no": 1 }, { "#text": "Didn't like to play it safe", "-no": 2 }, { "#text": "One component at a time", "-no": 3 }, { "#text": "There's got to be a better way", "-no": 4 }, { "#text": "Oh, people came from miles around", "-no": 5 }, { "#text": "Searching for a steady job", "-no": 6 }, { "#text": "Welcome to the Motor Town", "-no": 7 }, { "#text": "Booming like an atom bomb", "-no": 8 } ] }, { "-name": "verse 2", "-no": 2, "line": [ { "#text": "Oh, Henry was the end of the story", "-no": 1 }, { "#text": "Then everything went wrong", "-no": 2 }, { "#text": "And we'll return it to its former glory", "-no": 3 }, { "#text": "But it just takes so long", "-no": 4 } ] } ] } }, "text": "help me!" } } =================== TestGetValue ... Read doc: <entry><vars><foo>bar</foo><foo2><hello>world</hello></foo2></vars></entry> Looking for value: entry.vars { "foo": "bar", "foo2": { "hello": "world" } } Looking for value: entry.vars.foo2.hello world Looking with error in path: entry.var verr: no key in map: var DocValue() for tag path entry.vars { "foo": "bar", "foo2": { "hello": "world" } } =================== TestGetValueWithAttr ... Read doc: <entry><vars> <foo item="1">bar</foo> <foo item="2"> <hello item="3">world</hello> <hello item="4">universe</hello> </foo></vars></entry> Looking for value: entry.vars { "foo": [ { "#text": "bar", "-item": "1" }, { "-item": "2", "hello": [ { "#text": "world", "-item": "3" }, { "#text": "universe", "-item": "4" } ] } ] } MapValue(): Looking for value: entry.vars.foo item=2 { "-item": "2", "hello": [ { "#text": "world", "-item": "3" }, { "#text": "universe", "-item": "4" } ] } MapValue(): Looking for hello item:4 verr: no key in map: hello DocValue(): Looking for entry.vars.foo.hello item:4 verr: no keys beyond: foo DocValue(): Looking for empty nil { "entry": { "vars": { "foo": [ { "#text": "bar", "-item": "1" }, { "-item": "2", "hello": [ { "#text": "world", "-item": "3" }, { "#text": "universe", "-item": "4" } ] } ] } } } testing recast switch... MapValue(): Looking for value: entry.vars.foo item=2 { "-item": 2, "hello": [ { "#text": "world", "-item": 3 }, { "#text": "universe", "-item": 4 } ] } =================== TestStuff_1 ... <doc> <tag item="1">val2</tag> <tag item="2">val2</tag> <tag item="2" instance="2">val3</tag> </doc> doc : tag :[[]interface{}] [item: 0] -item :[string] 1 #text :[string] val2 [item: 1] -item :[string] 2 #text :[string] val2 [item: 2] -item :[string] 2 -instance :[string] 2 #text :[string] val3 DocValue(): tag [ { "#text": "val2", "-item": "1" }, { "#text": "val2", "-item": "2" }, { "#text": "val3", "-instance": "2", "-item": "2" } ] DocValue(): item:2 instance:2 "val3" =================== TestStuff_2 ... <tag item="1">val2</tag> <tag item="2">val2</tag> <tag item="2" instance="2">val3</tag> tag : #text :[string] val2 -item :[string] 1 DocValue(): tag { "#text": "val2", "-item": "1" } DocValue(): item:2 instance:2 verr: no attribute key:value pair: item:2 =================== TestBulkBuffer ... Bulk Message Processing Tests procMap: { "msg": { "-mpriority": "1", "-mtype": "alert", "song": { "-author": "Mayer Hawthorne", "-title": "A Long Time", "chorus": { "line": [ { "#text": "It's going to take a long time", "-no": "1" }, { "#text": "It's going to take it, but we'll make it one day", "-no": "2" }, { "#text": "It's going to take a long time", "-no": "3" }, { "#text": "It's going to take it, but we'll make it one day", "-no": "4" } ] }, "verses": { "verse": [ { "-name": "verse 1", "-no": "1", "line": [ { "#text": "Henry was a renegade", "-no": "1" }, { "#text": "Didn't like to play it safe", "-no": "2" }, { "#text": "One component at a time", "-no": "3" }, { "#text": "There's got to be a better way", "-no": "4" }, { "#text": "Oh, people came from miles around", "-no": "5" }, { "#text": "Searching for a steady job", "-no": "6" }, { "#text": "Welcome to the Motor Town", "-no": "7" }, { "#text": "Booming like an atom bomb", "-no": "8" } ] }, { "-name": "verse 2", "-no": "2", "line": [ { "#text": "Oh, Henry was the end of the story", "-no": "1" }, { "#text": "Then everything went wrong", "-no": "2" }, { "#text": "And we'll return it to its former glory", "-no": "3" }, { "#text": "But it just takes so long", "-no": "4" } ] } ] } }, "text": "help me!" } } procMap: { "msg": { "-mpriority": "1", "-mtype": "alert", "song": { "-author": "Mayer Hawthorne", "-title": "A Long Time", "verses": { "verse": { "-name": "verse 1", "-no": "1", "line": [ { "#text": "Henry was a renegade", "-no": "1" }, { "#text": "Didn't like to play it safe", "-no": "2" }, { "#text": "One component at a time", "-no": "3" }, { "#text": "There's got to be a better way", "-no": "4" }, { "#text": "Oh, people came from miles around", "-no": "5" }, { "#text": "Searching for a steady job", "-no": "6" }, { "#text": "Welcome to the Motor Town", "-no": "7" }, { "#text": "Booming like an atom bomb", "-no": "8" } ] } } }, "text": "help me!" } } procMap: { "msg": { "-mpriority": "1", "-mtype": "alert", "song": { "-author": "Mayer Hawthorne", "-title": "A Long Time", "chorus": { "line": [ { "#text": "It's going to take a long time", "-no": "1" }, { "#text": "It's going to take it, but we'll make it one day", "-no": "2" }, { "#text": "It's going to take a long time", "-no": "3" }, { "#text": "It's going to take it, but we'll make it one day", "-no": "4" } ] } }, "text": "help me!" } } procError err: XML syntax error on line 1: element <chorus> closed by </song> procError err: XML syntax error on line 1: unexpected end element </msg> =================== TestBulkBuffer ... Test arbitrary XML buffer with no ending rootTag - then read from closed buffer. m: map[doc:map[tag:]] m: map[doc:map[one:map[#text:my test doc -att:1]]] merr: XML syntax error on line 1: unexpected EOF err: Buffer is not active. =================== TestTagAndKey ... TestTagAndKey() <doc> <sections> <section>one</section> <section> <parts> <part>two.one</part> <part>two.two</part> </parts> </section> </sections> <partitions> <parts> <sections> <section>one</section> <section>two</section> </sections> </parts> </partitions> </doc> tag: parts :: len: 2 v: [map[part:[two.one two.two]] map[sections:map[section:[one two]]]] no 'not_a_tag' tag key: section :: len: 2 v: [[one map[parts:map[part:[two.one two.two]]]] [one two]] no 'not_a_key' key ============================ x2jat_test.go =============== TestValuesAtKeyPath ... ValuesAtKeyPath ... doc1#author ss: [doc.books.book.author] vv: [map[-seq:1 author:William H. Gaddis review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[-seq:2 author:Austin Tappan Wright review:An example of earlier 20th century American utopian fiction. title:Islandia] map[-seq:3 author:John Hawkes review:A lyrical novel about the construction of Ft. Peck Dam in Montana. title:The Beetle Leg] map[-seq:4 author:map[first_name:T.E. last_name:Porter] review:A magical novella. title:King's Day]] ValuesAtKeyPath ... doc1#first_name ss: [doc.books.book.author.first_name] vv: [William H. Gaddis Austin Tappan Wright John Hawkes map[first_name:T.E. last_name:Porter]] GetKeyPaths...doc2#book ss: [doc.books.author.book doc.books.author.books.book] vv: [map[book:[map[-seq:1 review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[review:Won the National Book Award title:JR]] name:William H. Gaddis] map[books:map[book:[map[title:The Beetle Leg] map[title:The Blood Oranges]]] name:John Hawkes]] vv: [map[book:[map[title:The Beetle Leg] map[title:The Blood Oranges]]]] vv,shortest_path: [map[book:[map[-seq:1 review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[review:Won the National Book Award title:JR]] name:William H. Gaddis] map[books:map[book:[map[title:The Beetle Leg] map[title:The Blood Oranges]]] name:John Hawkes]] ValuesAtKeyPath ... msg1#pub ss: [msg.pub] vv: [map[pub:test text:This is a long cold winter]] ValuesAtKeyPath ... msg2#pub ss: [msgs.msg.pub] vv: [map[pub:test text:This is a long cold winter] map[pub:test2 text:I hope we have a cool summer, though]] =============== TestValuesAtTagPath ... ValuesAtTagPath ... doc1#author ss: [doc.books.book.author] vv: [map[-seq:1 author:William H. Gaddis review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[-seq:2 author:Austin Tappan Wright review:An example of earlier 20th century American utopian fiction. title:Islandia] map[-seq:3 author:John Hawkes review:A lyrical novel about the construction of Ft. Peck Dam in Montana. title:The Beetle Leg] map[-seq:4 author:map[first_name:T.E. last_name:Porter] review:A magical novella. title:King's Day]] ValuesAtTagPath ... doc1#first_name ss: [doc.books.book.author.first_name] vv: [William H. Gaddis Austin Tappan Wright John Hawkes map[first_name:T.E. last_name:Porter]] ValuesAtTagPath...doc2#book ss: [doc.books.author.books.book doc.books.author.book] vv: [map[book:[map[title:The Beetle Leg] map[title:The Blood Oranges]]]] vv: [map[book:[map[-seq:1 review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[review:Won the National Book Award title:JR]] name:William H. Gaddis] map[books:map[book:[map[title:The Beetle Leg] map[title:The Blood Oranges]]] name:John Hawkes]] vv,shortest_path: [map[book:[map[-seq:1 review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[review:Won the National Book Award title:JR]] name:William H. Gaddis] map[books:map[book:[map[title:The Beetle Leg] map[title:The Blood Oranges]]] name:John Hawkes]] ================================ x2jfindPath_test.go =============== TestPathsForKey ... PathsForKey... doc01#author ss: [doc.books.book.author] PathsForKey... doc01#books ss: [doc.books] PathsForKey...doc02#book ss: [doc.books.author.book doc.books.author.books.book] PathForKeyShortest...doc02#book s: doc.books.author.book =============== TestPathsForTag ... PathsForTag... doc01#author ss: [doc.books.book.author] PathsForTag... doc01#books ss: [doc.books] PathsForTag...doc02#book ss: [doc.books.author.book doc.books.author.books.book] PathForTagShortest...doc02#book s: doc.books.author.book TestValuesFromTagPath() <doc> <books> <book seq="1"> <author>William H. Gaddis</author> <title>The Recognitions</title> <review>One of the great seminal American novels of the 20th century.</review> </book> <book seq="2"> <author>Austin Tappan Wright</author> <title>Islandia</title> <review>An example of earlier 20th century American utopian fiction.</review> </book> <book seq="3"> <author>John Hawkes</author> <title>The Beetle Leg</title> <review>A lyrical novel about the construction of Ft. Peck Dam in Montana.</review> </book> <book seq="4"> <author> <first_name>T.E.</first_name> <last_name>Porter</last_name> </author> <title>King's Day</title> <review>A magical novella.</review> </book> </books> </doc> map: doc : books : book :[[]interface{}] [item: 0] -seq :[string] 1 author :[string] William H. Gaddis title :[string] The Recognitions review :[string] One of the great seminal American novels of the 20th century. [item: 1] author :[string] Austin Tappan Wright title :[string] Islandia review :[string] An example of earlier 20th century American utopian fiction. -seq :[string] 2 [item: 2] -seq :[string] 3 author :[string] John Hawkes title :[string] The Beetle Leg review :[string] A lyrical novel about the construction of Ft. Peck Dam in Montana. [item: 3] -seq :[string] 4 author : first_name :[string] T.E. last_name :[string] Porter title :[string] King's Day review :[string] A magical novella. path == doc.books: len(v): 1 0 : map[book:[map[-seq:1 author:William H. Gaddis review:One of the great seminal American novels of the 20th century. title:The Recognitions] map[-seq:2 author:Austin Tappan Wright review:An example of earlier 20th century American utopian fiction. title:Islandia] map[-seq:3 author:John Hawkes review:A lyrical novel about the construction of Ft. Peck Dam in Montana. title:The Beetle Leg] map[-seq:4 author:map[first_name:T.E. last_name:Porter] review:A magical novella. title:King's Day]]] path == doc.books.*: len(v): 4 0 : map[-seq:1 author:William H. Gaddis review:One of the great seminal American novels of the 20th century. title:The Recognitions] 1 : map[-seq:2 author:Austin Tappan Wright review:An example of earlier 20th century American utopian fiction. title:Islandia] 2 : map[-seq:3 author:John Hawkes review:A lyrical novel about the construction of Ft. Peck Dam in Montana. title:The Beetle Leg] 3 : map[-seq:4 author:map[first_name:T.E. last_name:Porter] review:A magical novella. title:King's Day] path == doc.books.book: len(v): 4 0 : map[-seq:1 author:William H. Gaddis review:One of the great seminal American novels of the 20th century. title:The Recognitions] 1 : map[-seq:2 author:Austin Tappan Wright review:An example of earlier 20th century American utopian fiction. title:Islandia] 2 : map[-seq:3 author:John Hawkes review:A lyrical novel about the construction of Ft. Peck Dam in Montana. title:The Beetle Leg] 3 : map[-seq:4 author:map[first_name:T.E. last_name:Porter] review:A magical novella. title:King's Day] doc == doc2 / path == doc.books.book: len(v): 1 0 : map[-seq:1 author:William H. Gaddis review:One of the great seminal American novels of the 20th century. title:The Recognitions] path == doc.books.book.*: len(v): 12 0 : William H. Gaddis 1 : The Recognitions 2 : One of the great seminal American novels of the 20th century. 3 : Austin Tappan Wright 4 : Islandia 5 : An example of earlier 20th century American utopian fiction. 6 : John Hawkes 7 : The Beetle Leg 8 : A lyrical novel about the construction of Ft. Peck Dam in Montana. 9 : King's Day 10 : A magical novella. 11 : map[first_name:T.E. last_name:Porter] doc == doc2 / path == doc.books.book.*: len(v): 3 0 : William H. Gaddis 1 : The Recognitions 2 : One of the great seminal American novels of the 20th century. path == doc.books.*.author: len(v): 4 0 : William H. Gaddis 1 : Austin Tappan Wright 2 : John Hawkes 3 : map[first_name:T.E. last_name:Porter] path == doc.*.*.author: len(v): 4 0 : William H. Gaddis 1 : Austin Tappan Wright 2 : John Hawkes 3 : map[first_name:T.E. last_name:Porter] path == doc.*.*.title: len(v): 4 0 : The Recognitions 1 : Islandia 2 : The Beetle Leg 3 : King's Day path == doc.*.*.*: len(v): 12 0 : William H. Gaddis 1 : The Recognitions 2 : One of the great seminal American novels of the 20th century. 3 : Austin Tappan Wright 4 : Islandia 5 : An example of earlier 20th century American utopian fiction. 6 : John Hawkes 7 : The Beetle Leg 8 : A lyrical novel about the construction of Ft. Peck Dam in Montana. 9 : A magical novella. 10 : map[first_name:T.E. last_name:Porter] 11 : King's Day path == doc.*.*.*.*: len(v): 2 0 : T.E. 1 : Porter TestValuesFromTagPath2(), iteration: 0 <?xml version="1.0" encoding="UTF-8"?> <data> <netid> <disable>no</disable> <text1>default:text</text1> <word1>default:word</word1> </netid> </data> map: data : netid : disable :[string] no text1 :[string] default:text word1 :[string] default:word path == data.*: len(v): 1 0 : map[disable:no text1:default:text word1:default:word] text1 : default:text word1 : default:word disable : no path == data.*.*: len(v): 3 0 : no 1 : default:text 2 : default:word TestValuesFromTagPath2(), iteration: 1 <?xml version="1.0" encoding="UTF-8"?> <data> <idnet> <disable>yes</disable> <text1>default:text</text1> <word1>default:word</word1> </idnet> </data> map: data : idnet : disable :[string] yes text1 :[string] default:text word1 :[string] default:word path == data.*: len(v): 1 0 : map[disable:yes text1:default:text word1:default:word] disable : yes text1 : default:text word1 : default:word path == data.*.*: len(v): 3 0 : yes 1 : default:text 2 : default:word Unmarshal test ... *map[string]interface{}, *string m: map[doc:map[name:Mayer Hawthorne song:map[title:A Long Time verse:map[-no:1 line:[map[#text:Henry was a renegade -no:1] map[#text:Didn't like to play it safe -no:2]]]]]] s: {"doc":{"name":"Mayer Hawthorne","song":{"title":"A Long Time","verse":{"-no":"1","line":[{"#text":"Henry was a renegade","-no":"1"},{"#text":"Didn't like to play it safe","-no":"2"}]}}}} Unmarshal test ... struct: <info><name>clbanning</name><address>unknown</address></info> myInfo: {XMLName:{Space: Local:info} Name:clbanning Address:unknown} TestMapValue of doc.song.verse w/ len(attrs) == 0. doc: <doc> <name>Mayer Hawthorne</name> <song> <title>A Long Time</title> <verse no="1"> <line no="1">Henry was a renegade</line> <line no="2">Didn't like to play it safe</line> </verse> </song> </doc> result: map[-no:1 line:[map[#text:Henry was a renegade -no:1] map[#text:Didn't like to play it safe -no:2]]] PASS ok github.com/clbanning/x2j 0.015s + RPM_EC=0 ++ jobs -p + exit 0 Processing files: golang-github-clbanning-x2j-devel-1.1-1.mga9.noarch Executing(%doc): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.P7UHxX + umask 022 + cd /home/iurt/rpmbuild/BUILD + cd x2j-1.1 + DOCDIR=/home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/doc/golang-github-clbanning-x2j-devel + export LC_ALL=C + LC_ALL=C + export DOCDIR + /usr/bin/mkdir -p /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/doc/golang-github-clbanning-x2j-devel + cp -pr README /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/doc/golang-github-clbanning-x2j-devel + cp -pr examples /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/doc/golang-github-clbanning-x2j-devel + RPM_EC=0 ++ jobs -p + exit 0 Executing(%license): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.7k365B + umask 022 + cd /home/iurt/rpmbuild/BUILD + cd x2j-1.1 + LICENSEDIR=/home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/licenses/golang-github-clbanning-x2j-devel + export LC_ALL=C + LC_ALL=C + export LICENSEDIR + /usr/bin/mkdir -p /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/licenses/golang-github-clbanning-x2j-devel + cp -pr LICENSE /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64/usr/share/licenses/golang-github-clbanning-x2j-devel + RPM_EC=0 ++ jobs -p + exit 0 Provides: golang(github.com/clbanning/x2j) = 1.1-1.mga9 golang(github.com/clbanning/x2j)(tag=1.1) = 1.1-1.mga9 golang-github-clbanning-x2j-devel = 1.1-1.mga9 golang-ipath(github.com/clbanning/x2j) = 1.1-1.mga9 golang-ipath(github.com/clbanning/x2j)(tag=1.1) = 1.1-1.mga9 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: go-filesystem Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 Wrote: /home/iurt/rpmbuild/RPMS/noarch/golang-github-clbanning-x2j-devel-1.1-1.mga9.noarch.rpm Executing(%clean): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.4wBYyF + umask 022 + cd /home/iurt/rpmbuild/BUILD + cd x2j-1.1 + /usr/bin/rm -rf /home/iurt/rpmbuild/BUILDROOT/golang-github-clbanning-x2j-1.1-1.mga9.aarch64 + RPM_EC=0 ++ jobs -p + exit 0 Executing(--clean): /bin/sh -e /home/iurt/rpmbuild/tmp/rpm-tmp.FU1dsY + umask 022 + cd /home/iurt/rpmbuild/BUILD + rm -rf x2j-1.1 + RPM_EC=0 ++ jobs -p + exit 0 D: [iurt_root_command] Success!