inspectable_byte_string

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InspectableByteString

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

func NewInspectableByteString

func NewInspectableByteString(bytes []byte) InspectableByteString

func (InspectableByteString) FormatWithHighlightedOffset

func (s InspectableByteString) FormatWithHighlightedOffset(highlightOffset int, highlightText string, formattedStringPrefix string, formattedStringSuffix string) string

FormatWithHighlightedOffset returns a string that represents the bytes with the byteOffset highlighted

For example, if called with highlightOffset 4, highlightText "error" and formattedString "Received: ", the return value will be:

> Received: "+OK\r\n" > ^ error

func (InspectableByteString) FormattedString

func (s InspectableByteString) FormattedString() string

func (InspectableByteString) GetOffsetInFormattedString

func (s InspectableByteString) GetOffsetInFormattedString(byteOffset int) int

GetOffsetInFormattedString returns a string that represents the byteOffset in the formatted string

For example:

  • If the string is "+OK\r\n"
  • And byteOffset is 4 (i.e. \n, the 5th byte)
  • The return value will be 6 (i.e. the 6th character in the formatted string)

func (InspectableByteString) TruncateAroundOffset

func (s InspectableByteString) TruncateAroundOffset(offset int) InspectableByteString

Jump to

Keyboard shortcuts

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