1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-05 17:00:20 +00:00

go mod and vendor changes

This commit is contained in:
rajashree
2019-11-13 14:46:03 -08:00
committed by Alena Prokharchyk
parent 9c1c0ea999
commit 091fa14a5d
200 changed files with 12739 additions and 20 deletions

25
vendor/github.com/huandu/xstrings/common.go generated vendored Normal file
View File

@@ -0,0 +1,25 @@
// Copyright 2015 Huan Du. All rights reserved.
// Licensed under the MIT license that can be found in the LICENSE file.
package xstrings
import (
"bytes"
)
const bufferMaxInitGrowSize = 2048
// Lazy initialize a buffer.
func allocBuffer(orig, cur string) *bytes.Buffer {
output := &bytes.Buffer{}
maxSize := len(orig) * 4
// Avoid to reserve too much memory at once.
if maxSize > bufferMaxInitGrowSize {
maxSize = bufferMaxInitGrowSize
}
output.Grow(maxSize)
output.WriteString(orig[:len(orig)-len(cur)])
return output
}