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

Return objects implementing Fmt.Formatter. #70

Closed
prataprc opened this issue May 26, 2017 · 1 comment
Closed

Return objects implementing Fmt.Formatter. #70

prataprc opened this issue May 26, 2017 · 1 comment
Labels

Comments

@prataprc
Copy link

Right now, if we are going to use Sprint, Sprintf, Sprintln outputs and
perform further formatting on the returned string as:

    fmt.Printf("%-10s", color.New(color.FgYellow).Sprint("hello"))

it may not give the correct padding.

To handle such cases, implement a set of functions that can return
formattable objects outside color/ package.

To begin with, I might propose the following:

Implement a set of functions similar to Sprint, Sprintf, Sprintln.
And another set of functions similar to SprintFunc, SprintfFunc SprintlnFunc
that returns an object implementing fmt.Formatter{} interface.

If it make sense, I can do a draft implementation and raise a pull request.

Thanks,

@fatih
Copy link
Owner

fatih commented Oct 10, 2018

Hi,

Unfortunately, I'm archiving this project and will no longer maintaining it. For more information, please read my blog post: Taking an indefinite sabbatical from my projects.

Thanks for the feedback and contribution.

@fatih fatih closed this as completed Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants