minformat

package
v0.0.0-...-f7164a8 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package minformat implements Go source code minification routines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Node

func Node(w io.Writer, fset *token.FileSet, node interface{}) error

Node formats node by removing as much whitespace as possible and writes the result to w.

Result contains no comments.

The node type is defined as interface{} for compatibility with go/format.Node function. Only ast.Node types are supported right now.

The function may return early (before the entire result is written) and return a formatting error, for instance due to an incorrect AST.

func Source

func Source(src []byte) ([]byte, error)

Source formats src by removing as mych whitespace as possible and returns the result.

src is expected to be a syntactically correct Go source file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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