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

Issue: new lines with extra character #20

Closed
areYouLazy opened this issue Jun 18, 2021 · 1 comment
Closed

Issue: new lines with extra character #20

areYouLazy opened this issue Jun 18, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@areYouLazy
Copy link
Owner

Describe the bug
Lines added by this library has an extra \t character you can see in hosty output as described here: areYouLazy/hosty#2

To Reproduce
Steps to reproduce the behavior:

  1. Add a line with this library (or use hosty
  2. Add a new line by hand
  3. Print lines to CLI to show the extra \t character

Expected behavior
New lines should not add extra characters, also considering we can't have lines with infinite length

@areYouLazy areYouLazy added the bug Something isn't working label Jun 18, 2021
@areYouLazy
Copy link
Owner Author

areYouLazy commented Jun 18, 2021

Example:

return fmt.Sprintf("# %-16s\t%s\t#%s", hfl.Address, strings.Join(hfl.Hostnames, " "), hfl.Comment)

Maybe we should get something like:

	return fmt.Sprintf("# %-16s %s #%s", hfl.Address, strings.Join(hfl.Hostnames, " "), hfl.Comment)

That will keep the 16chars for address and uses a space to separate IP-Hostnames-Comment parts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant