bytes

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2019 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SharedBuffer

type SharedBuffer struct {
	// contains filtered or unexported fields
}

SharedBuffer is a goroutine safe bytes.Buffer

Origin:

https://gist.github.com/arkan/5924e155dbb4254b64614069ba0afd81
https://github.com/arkan

Changes:

  • buffer field is now a pointer
  • Renamed to SharedBuffer
  • Added NewSharedBuffer

func NewSharedBuffer

func NewSharedBuffer() *SharedBuffer

func (*SharedBuffer) String

func (s *SharedBuffer) String() string

String returns the contents of the unread portion of the buffer as a string. If the SharedBuffer is a nil pointer, it returns "<nil>".

func (*SharedBuffer) Unshared

func (s *SharedBuffer) Unshared() *std_bytes.Buffer

func (*SharedBuffer) Write

func (s *SharedBuffer) Write(p []byte) (n int, err error)

Write appends the contents of p to the buffer, growing the buffer as needed. It returns the number of bytes written.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL