Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Writing properties #1

Open
krpors opened this issue May 16, 2012 · 3 comments
Open

Writing properties #1

krpors opened this issue May 16, 2012 · 3 comments
Assignees

Comments

@krpors
Copy link

krpors commented May 16, 2012

Any chance you'll be working on Write function(s) for this project in the near future?

@dmotylev
Copy link
Owner

Hello,

Well, I can find time on next week for that.

Do you have any particular requirements?

Dmitry Motylev

On Wednesday, 16 May 2012 г. at 19:36, Kevin Pors wrote:

Any chance you'll be working on Write function(s) for this project in the near future?


Reply to this email directly or view it on GitHub:
#1

@krpors
Copy link
Author

krpors commented May 17, 2012

None yet, just writing the properties back to a file using some kind of writer would be nice. Also, you could also implement the properties by something like this:

type Properties map[string]string

func (p *Properties) Load() error {
    // do stuff, p["thing"] = "that"
    return nil
}

func (p *Properties) GetAsBool(key string, def bool) bool {
    // use strconv to convert to bool, or return def if 
    // conversion failed.
    return false
}

func (p *Properties) GetAsInt8(key string, def int8) int8 {
    // use strconv to convert to int8
    return 0
}

Thoughts?

@ghost ghost assigned dmotylev May 27, 2012
@dmotylev
Copy link
Owner

dmotylev commented Jan 2, 2013

Type with handy helpers implemented in 2f8a0df

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants