ioutils

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ioutils provides APIs related to input and output.

Index

Constants

View Source
const CmdName string = "mkgoprj"

CmdName is this command name.

Variables

View Source
var (
	// Stdout is new instance of Writer which handles escape sequence for stdout.
	Stdout = colorable.NewColorableStdout()
	// Stderr is new instance of Writer which handles escape sequence for stderr.
	Stderr = colorable.NewColorableStderr()
)

Functions

func Die

func Die(msg string)

Die exit program with message.

func Exists

func Exists(path string) bool

Exists check whether file or directory exists.

func IsFile

func IsFile(path string) bool

IsFile reports whether the path exists and is a file.

func MkDirs

func MkDirs(paths []string)

MkDirs create multiple specified directories. If the parent directory does not exist, create the parent directory as well. If an error occurs, exit command.

func Tree

func Tree(path string)

Tree display directories in the tree structure.

func Warn

func Warn(msg string)

Warn print warning message

func WriteFile

func WriteFile(text string, path string)

WriteFile write string to file. If it can not create file, exit command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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