format

package
v0.0.0-...-bc5a6c4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(value types.Type) (string, error)

String prints a value to a string.

Types

type Snippet

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

Snippet represents a collection of tokens.

func Format

func Format(value interface{}) (*Snippet, error)

Format produces a snippet representation of the value.

func NewSnippet

func NewSnippet() *Snippet

NewSnippet creates a new empty snippet.

func (*Snippet) Dump

func (snippet *Snippet) Dump() []Token

Dump renders the snippet to a series of tokens.

type Token

type Token struct {
	Text string
	Kind string
}

Token is a block of formatted code.

Jump to

Keyboard shortcuts

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