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

adding left string function #6189

Merged
merged 2 commits into from
Jul 31, 2019
Merged

adding left string function #6189

merged 2 commits into from
Jul 31, 2019

Conversation

russorat
Copy link
Contributor

@russorat russorat commented Jul 31, 2019

closes: #5877

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@@ -270,6 +277,11 @@ func (s *Strings) initOnce() {
}
s.converters = append(s.converters, c)
}
for _, c := range s.Left {
c := c
c.fn = func(s string) string { return s[:c.Width] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panic when width > len(s)

@russorat
Copy link
Contributor Author

🤦‍♂ fixed panic, added test

@danielnelson danielnelson added this to the 1.12.0 milestone Jul 31, 2019
@danielnelson danielnelson added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jul 31, 2019
@danielnelson danielnelson merged commit ef4f4ee into master Jul 31, 2019
@danielnelson danielnelson deleted the add-left-trim branch July 31, 2019 23:55
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegraf strings processor trim to length
3 participants