fileutil

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fileutil provides functionality to subvert os and ioutil calls when needed for particular operating systems (js) or runtimes (asset data packaged into a binary)

Index

Constants

This section is empty.

Variables

View Source
var (
	// BindataFn is a function to access binary data outside of os.Open
	BindataFn func(string) ([]byte, error)
	// BindataDir is a function to access directory representations alike to ioutil.ReadDir
	BindataDir func(string) ([]string, error)
)

Functions

func Open

func Open(file string) (io.ReadCloser, error)

Open is a wrapper around os.Open that will also check a function to access byte data. The intended use is to use the go-bindata library to create an Asset function that matches this signature.

func ReadDir

func ReadDir(file string) ([]os.FileInfo, error)

ReadDir replaces ioutil.ReadDir, trying to use the BinaryDir if it exists.

func ReadFile

func ReadFile(file string) ([]byte, error)

ReadFile replaces ioutil.ReadFile, trying to use the BindataFn if it exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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