alexejk / go-xmlrpc

An XML-RPC Client for Go
https://alexejk.io/article/handling-xmlrpc-in-go/
MIT License
19 stars 7 forks source link

Support decoding structs into Go maps #79

Closed alexejk closed 8 months ago

alexejk commented 8 months ago

As has been mentioned in #77, in some cases an XML-RPC struct member names are not known at compile time. This makes definitions of response datatypes much more complicated or not always possible.

To workaround this, StrDecoder can now accept map[string]any values alongside struct values. In order to not over-complicate things a limitation on the map's key type to be a string has been added.

This new functionality should be backwards compatible as existing codebases could never use map datatypes for decoding, thus introducing additional flexibility to struct decoding won't cause any problems.

Fixes #77

sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
93.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 8 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (2830010) 75.38% compared to head (abbf585) 75.60%.

Files Patch % Lines
decode.go 93.33% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #79 +/- ## ========================================== + Coverage 75.38% 75.60% +0.21% ========================================== Files 7 7 Lines 524 541 +17 ========================================== + Hits 395 409 +14 - Misses 99 101 +2 - Partials 30 31 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.