Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a place in goconfig misleading me #58

Closed
tw4452852 opened this issue Dec 19, 2012 · 1 comment
Closed

a place in goconfig misleading me #58

tw4452852 opened this issue Dec 19, 2012 · 1 comment

Comments

@tw4452852
Copy link

Hi,
Today, I read revel's src, and find a place in goconfig that I can't understand. Can you help me?
in goconfig/config/read.go Line93, why getting the index of "=:" twice, I think inner one is same as the outer one.

// Other alternatives
        default:
            i := strings.IndexAny(l, "=:")

            switch {
            // Option and value
            case i > 0:
                i := strings.IndexAny(l, "=:")
                option = strings.TrimSpace(l[0:i])
                value := strings.TrimSpace(stripComments(l[i+1:]))
                self.AddOption(section, option, value)
            // Continuation of multi-line value
            case section != "" && option != "":
                prev, _ := self.RawString(section, option)
                value := strings.TrimSpace(stripComments(l))
                self.AddOption(section, option, prev+"\n"+value)

            default:
                return errors.New("could not parse line: " + l)
            }
        }
@robfig
Copy link
Contributor

robfig commented Dec 19, 2012

I'm not sure, as I didn't write that. I would suggest asking in this project:
https://github.com/kless/goconfig

@robfig robfig closed this as completed Dec 19, 2012
kumakichi pushed a commit to kumakichi/revel that referenced this issue Nov 2, 2018
skeleton moved successfully to cmd repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants