Conversation
Resolves valyala#53 Convenience function so users don't have to do: ```go s := string(v.GetStringBytes("key", "a", "b")) ```
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54 +/- ##
==========================================
+ Coverage 97.00% 97.01% +0.01%
==========================================
Files 9 9
Lines 1067 1072 +5
==========================================
+ Hits 1035 1040 +5
Misses 19 19
Partials 13 13 ☔ View full report in Codecov by Sentry. |
| // Array indexes may be represented as decimal numbers in keys. | ||
| // | ||
| // "" is returned for non-existing keys path or for invalid value type. | ||
| func (v *Value) GetString(keys ...string) string { |
There was a problem hiding this comment.
I didn't add an equivalent String function because that would collide with the existing one that returns a string representation of the value.
|
Unfortunately this won't work as expected, since the returned string will contain garbage after the next call to |
|
What do you suggest? |
|
Either stick to |
|
What if GetString returned string(v.GetStringBytes())? |
|
|
Resolves #53
Convenience function so users don't have to do: