io

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPath = errors.New("invalid path, line %d")
)

Functions

func AppendFile added in v1.2.0

func AppendFile(filename string, content string) (val i, err error)

Appends content to file. func appendFile(filename string, content string)

func CurDir added in v1.2.0

func CurDir() (str i, err error)

Returns current working directory func curDir() string

func Exists added in v1.2.0

func Exists(filename string) (val i, err error)

Returns true if file exists. func exists(filename string) bool

func Input added in v1.2.0

func Input(prompt string) (input i, err error)

Gets user input from stdin. func input(prompt string) string

func NewDir added in v1.2.0

func NewDir(dirname string) (val i, err error)

Creates new directory. func newDir(name string)

func NewFile added in v1.2.0

func NewFile(filename string) (val i, err error)

Creates new file. If the file already exists it will be overwritten. func newFile(name string)

func ReadDir added in v1.2.0

func ReadDir(dir string) (val i, err error)

Returns list of files/directories in dir. func readDir(dir string) []string

func ReadFile added in v1.2.0

func ReadFile(filename string) (str i, err error)

Reads file and returns text. func readFile(filename string) string

func WriteFile added in v1.2.0

func WriteFile(filename string, content string) (val i, err error)

Writes content to file. Overwrites previous file content. func writeFile(filename string, content string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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