Skip to content

Add ParseCapacityString#10956

Merged
raskchanky merged 3 commits into
masterfrom
logshipper-oss
Feb 22, 2021
Merged

Add ParseCapacityString#10956
raskchanky merged 3 commits into
masterfrom
logshipper-oss

Conversation

@raskchanky
Copy link
Copy Markdown
Collaborator

@raskchanky raskchanky added this to the 1.7 milestone Feb 20, 2021
Copy link
Copy Markdown
Contributor

@briankassouf briankassouf left a comment

Choose a reason for hiding this comment

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

One small comment, otherwise looks good!

Comment thread sdk/helper/parseutil/parseutil.go Outdated
// gib, tb, tib, which are not case sensitive. If no prefix is present, the number is assumed
// to be in bytes already.
func ParseCapacityString(in interface{}) (uint64, error) {
var validCapacityString = regexp.MustCompile("^[\t ]*([0-9]+)[\t ]?([kmgtKMGT][iI]?[bB])?[\t ]*$")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we move the regex to a package var so we don't have to recompile on each call?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep, will do

@vercel vercel Bot temporarily deployed to Preview – vault February 22, 2021 17:30 Inactive
@vercel vercel Bot temporarily deployed to Preview – vault-storybook February 22, 2021 17:30 Inactive
@vercel vercel Bot temporarily deployed to Preview – vault-storybook February 22, 2021 17:59 Inactive
@vercel vercel Bot temporarily deployed to Preview – vault February 22, 2021 17:59 Inactive
@raskchanky raskchanky merged commit 7684db9 into master Feb 22, 2021
@raskchanky raskchanky deleted the logshipper-oss branch February 22, 2021 18:44
tsaarni pushed a commit to Nordix/vault that referenced this pull request Jan 8, 2026
…) (hashicorp#10956)

Co-authored-by: Vault Automation <github-team-secure-vault-core@hashicorp.com>
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.

3 participants