This PR changes the xml:base implementation to use state maintained by the goxxp parser instead of using a shared urlStack. This allows Parser to be safely used concurrently.
With the url stack state maintined by goxpp, all of the methods of the old XMLBase type become package-level helper functions of shared (these are still in internal/shared/xmlbase.go though they could be moved to parseutils.go).
This is an alternative to #201 to fix #160 and #159.
To test:
go test -race
Note that this PR does not update go.mod. I guess that needs to be done after a release of goxpp if the above PR is accepted. For development purposes I have this line in go.mod pointing to a local copy of goxpp:
This PR changes the xml:base implementation to use state maintained by the goxxp parser instead of using a shared urlStack. This allows Parser to be safely used concurrently.
Depends on: https://github.com/mmcdole/goxpp/pull/9
With the url stack state maintined by goxpp, all of the methods of the old XMLBase type become package-level helper functions of
shared
(these are still ininternal/shared/xmlbase.go
though they could be moved toparseutils.go
).This is an alternative to #201 to fix #160 and #159.
To test:
go test -race
Note that this PR does not update go.mod. I guess that needs to be done after a release of goxpp if the above PR is accepted. For development purposes I have this line in go.mod pointing to a local copy of goxpp:
replace github.com/mmcdole/goxpp => ../goxpp/