Documentation ¶
Index ¶
- Variables
- func DeleteFile(filepath string) error
- func Exists(path string) bool
- func OpenWithEditor(path string) error
- func PersistExecutableFile(path, content string) error
- func PersistFile(path, content string) error
- func ReadFile(path string) ([]byte, error)
- func Walk(source string) ([]string, error)
- func WalkRelative(source string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var AllowedEditors = []string{
"/bin/ed",
"/bin/nano",
"/usr/bin/vim",
"nano",
"vim",
}
AllowedEditors is a list of allowed values for the EDITOR environment variable. FIXME: prevent unknown command execution when some of these editor is not available. FIXME: make this a function so is not directly modifiable.
Functions ¶
func OpenWithEditor ¶
OpenWithEditor open the specified path with the EDITOR set in the corresponding environment variable.
func PersistExecutableFile ¶
PersistExecutableFile writes a content to a path and make it executable.
func PersistFile ¶
PersistFile writes content to a path.
func WalkRelative ¶
WalkRelative walks the specified source path and return a slice of relative paths contained.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.