Help us shape the future of Go! Take the 2026 Go Developer Survey

cmd

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ResetSettings added in v1.0.0

func ResetSettings()

ResetSettings resets command settings to default. This is only required by the test suite to make sure that the flag parsing works correctly.

Types

type ExitCode added in v1.0.0

type ExitCode struct {
	Value int
	Cause error
}

ExitCode is just a way to transport the exit code to the main package

func (ExitCode) Error added in v1.0.0

func (e ExitCode) Error() string

type OutputWriter

type OutputWriter struct {
	PlainMode        bool
	Restructure      bool
	OmitIndentHelper bool
	OutputStyle      string
}

OutputWriter encapsulates the required fields to define the look and feel of the output

func (*OutputWriter) WriteInplace

func (w *OutputWriter) WriteInplace(filename string) error

WriteInplace writes the content of the documents stored in the provided input file to the file itself overwriting the content in place.

func (*OutputWriter) WriteToStdout

func (w *OutputWriter) WriteToStdout(filename string) error

WriteToStdout is a convenience function to write the content of the documents stored in the provided input file to the standard output

Jump to

Keyboard shortcuts

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