func (v *View) Grow(length int64, zero bool) {
	if length < 0 {
		panic("negative length provided")
	}
	for v.size < length {
		buf := v.data.Back()

		// Is there at least one buffer?
		if buf == nil || buf.Full() {
			buf = bufferPool.Get().(*Buffer)
			v.data.PushBack(buf)
		}

		// Write up to length bytes.
		l := len(buf.data) - buf.write
		if int64(l) > length-v.size {
			l = int(length - v.size)
		}

		// Zero the written section; note that this pattern is
		// specifically recognized and optimized by the compiler.
		if zero {
			for i := buf.write; i < buf.write+l; i++ {
				buf.data[i] = 0
			}
		}

		// Advance the index.
		buf.write += l
		v.size += int64(l)
	}
}
// Grow grows the given view to the number of bytes. If zero
// is true, all these bytes will be zero. If zero is false,
// then this is the caller's responsibility.
//
// Precondition: length must be >= 0.
Grow grows the given view to the number of bytes. If zero
is true, all these bytes will be zero. If zero is false,
then this is the caller's responsibility.

length must be >= 0.
// Grow grows the given view to the number of bytes . If zero // is true all these bytes will be zero . If zero is false // then this is the caller ' s responsibility . // // Precondition : length must be > = 0 .
func (v *View) Grow(length int64, zero bool) {
	if length < 0 {
		panic("negative length provided")
	}
	for v.size < length {
		buf := v.data.Back()
		if buf == nil || buf.Full() {
			buf = bufferPool.Get().(*Buffer)
			v.data.PushBack(buf)
		}
		l := len(buf.data) - buf.write
		if int64(l) > length-v.size {
			l = int(length - v.size)
		}
		if zero {
			for i := buf.write; i < buf.write+l; i++ {
				buf.data[i] = 0
			}
		}
		buf.write += l
		v.size += int64(l)
	}
}
func ( v * View ) Grow ( length int64 , zero bool ) { if length < 0 { panic ( " " ) } for v . size < length { buf := v . data . Back ( ) if buf == nil || buf . Full ( ) { buf = bufferPool . Get ( ) . ( * Buffer ) v . data . PushBack ( buf ) } l := len ( buf . data ) - buf . write if int64 ( l ) > length - v . size { l = int ( length - v . size ) } if zero { for i := buf . write ; i < buf . write + l ; i ++ { buf . data [ i ] = 0 } } buf . write += l v . size += int64 ( l ) } }
Grow grows the given view to the number of bytes.
Grow grows the given view to the number of bytes .
// Is there at least one buffer? // Write up to length bytes. // Zero the written section; note that this pattern is // specifically recognized and optimized by the compiler. // Advance the index.