Closed theherk closed 7 years ago
@theherk Good point. I think adding corresponding helper methods for the supported types makes sense.
I've added SetBool
, SetInt
, SetInt64
, SetFloat64
, SetString
, SetDuration
, SetUint
and SetUint64
to complement the existing getter functions. I think a single SetValue(key string, value interface{}) error
might make more sense. What do you think?
I think you're right. I felt more confident about my thoughts when I opened the issue, but that faded. I think the SetValue makes good sense.
@theherk Added a patch for the SetValue
method but I'd still like to think about it a bit more. SetValue
just calls Set
with fmt.Sprintf("%v", value)
as value.
%v
also uses the String()
method, if defined.
I'm not sure if I'm missing something, but it seems you can only set properties to strings. I know you can read other types, but what if I was to SetInt()?