You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for sharing your work. I find your package very useful. My properties files must also be edited by administrators. In my program I remove program generated properties and rewrite the properties file. Maintaining the order of the keys and the comments enables a friendlier file for administrators. The comments are transferred using GetComments. I could not find another way to keep the unexpanded property values, except by filtering them.
Currently the order of the keys is not maintained when any of the Filter, FilterRegexp or FilterPrefix is called. A small set of changes in properties.go will enable this.
// FilterRegexp returns a new properties object which contains all properties// for which the key matches the regular expression.func (p*Properties) FilterRegexp(re*regexp.Regexp) *Properties {
pp:=NewProperties()
//for k, v := range p.m {for_, k:=rangep.k {
ifre.MatchString(k) {
// pp.Set(k, v)pp.Set(k, p.m[k])
}
}
returnpp
}
// FilterPrefix returns a new properties object which contains all properties// for which the key starts with the prefix.func (p*Properties) FilterPrefix(prefixstring) *Properties {
pp:=NewProperties()
//for k, v := range p.m {for_, k:=rangep.k {
ifstrings.HasPrefix(k, prefix) {
// pp.Set(k, v)pp.Set(k, p.m[k])
}
}
returnpp
}
Thanks,
Wilbert
The text was updated successfully, but these errors were encountered:
Hi all,
Thanks for sharing your work. I find your package very useful. My properties files must also be edited by administrators. In my program I remove program generated properties and rewrite the properties file. Maintaining the order of the keys and the comments enables a friendlier file for administrators. The comments are transferred using GetComments. I could not find another way to keep the unexpanded property values, except by filtering them.
Currently the order of the keys is not maintained when any of the Filter, FilterRegexp or FilterPrefix is called. A small set of changes in properties.go will enable this.
Thanks,
Wilbert
The text was updated successfully, but these errors were encountered: