Documentation
¶
Overview ¶
Package fmtutil implements some formatting utility functions.
Index ¶
- Variables
- func FprintIf(w io.Writer, a ...any) (n int, err error)
- func FprintfIf(w io.Writer, format string, a ...any) (n int, err error)
- func MustPrintJSON(in any)
- func MustPrintJSONReader(r io.Reader, prefix, indent string)
- func PrintJSON(in any) error
- func PrintJSONMin(in any) error
- func PrintJSONMore(in any, jsonPrefix, jsonIndent string) error
- func PrintJSONReader(r io.Reader, prefix, indent string) error
- func PrintReader(r io.Reader) error
- func SprintfFormatLeadingCharLength(char string, length int) string
- func SprintfFormatLeadingCharMaxIntVal(char string, value int) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( JSONPretty bool = true JSONPrefix string = "" JSONIndent string = " " )
Functions ¶
func FprintIf ¶ added in v0.70.4
FprintIf is like `fmt.Fprint()` but doesn't fail when `io.Writer` is `nil`.
func FprintfIf ¶ added in v0.70.4
FprintfIf is like `fmt.Fprintf()` but doesn't fail when `io.Writer` is `nil`.
func MustPrintJSON ¶ added in v0.37.3
func MustPrintJSON(in any)
func MustPrintJSONReader ¶ added in v0.68.8
func PrintJSONMin ¶
PrintJSONMin pretty prints anything using a default indentation
func PrintJSONMore ¶
PrintJSONMore pretty prints anything using supplied indentation.
func PrintJSONReader ¶ added in v0.68.8
func PrintReader ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.