Menu Close

Go – bytes package in go

bytes package in go is used to implements functions for the manipulation of byte slices. It’s similar to the facilities of strings package.

Import bytes package in go:

 import "bytes"

bytes package Functions

Types

type Buffer:

type Buffer functions

  • NewBuffer()
  • Grow()
  • ReadByte()
  • ReadString()
  • UnreadByte()
  • WriteRune()
  • NewBufferString()
  • Len()
  • ReadBytes()
  • Reset()
  • UnreadRune()
  • WriteString()
  • Bytes()
  • Next()
  • ReadFrom()
  • String()
  • Write()
  • WriteTo()
  • Cap()
  • Read()
  • ReadRune()
  • Truncate()
  • WriteByte()

type Reader:

type Reader functions

  • NewReader()
  • ReadByte()
  • Size()
  • Len()
  • ReadRune()
  • UnreadByte()
  • Read()
  • Reset()
  • UnreadRune()
  • ReadAt()
  • Seek()
  • WriteTo()

To learn more about golang, Please refer given below link.

https://techieindoor.com/go-lang-tutorial/

References:

https://golang.org/doc/

Posted in bytes, golang, packages

Leave a Reply

Your email address will not be published. Required fields are marked *