Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@denniszl
Copy link

@denniszl denniszl commented Sep 25, 2017

This used to print maps without the type when we were looking to use this for code generation. So

values:
    foo: true

would print as

{
foo: true
}

Now it should print as a typed map (or typed as interface{}) e.g.

map[string]bool{
    foo: true,
}

@k0kubun
Copy link
Owner

k0kubun commented Sep 26, 2017

Are you using pp for code generation with NoColor configuration?

As it's designed not for serializing Go objects but for debug, I want to keep output simple. Missing type for map/slice is intentional. But sometimes type information is convenient for debug too, so I'm okay to optionally allow that feature. Could you add some configuration variable to enable that?

@denniszl
Copy link
Author

It should be updated now. I think I made it turned on by default, I can change that if it's not desirable.

@k0kubun
Copy link
Owner

k0kubun commented Sep 26, 2017

Hmm, I've misunderstood behavior for slice. This is consistent with it. So I agree that this is reasonable default. Let's introduce this and wait for feedback.

@k0kubun k0kubun merged commit e057ee7 into k0kubun:master Sep 26, 2017
@itchyny itchyny mentioned this pull request Mar 3, 2019
k0kubun added a commit that referenced this pull request Mar 4, 2019
According to the GitHub search, there seem to be no user after introducing it.
And by its very nature of this tool's purpose, it's very unlikely that
users maintain customized configuration variables in their code.

To simplify the implementation, I decided to drop this feature.
See also #25 for the original
discussion.
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

Successfully merging this pull request may close these issues.

2 participants