paths

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(fileName string) string

Find locates the passed datafile shortname and returns an absolute or relative path to find the datafile at.

For example, for "Tibia.pic" it may return "mybinary.runfiles/go_tibia/datafiles/Tibia.pic".

TODO(ivucica): Support finding over HTTP.

func NoFindOpen

func NoFindOpen(fileName string) (interface {
	io.ReadCloser
	io.Seeker
}, error)

func Open

func Open(fileName string) (interface {
	io.ReadCloser
	io.Seeker
}, error)

Open locates the passed file in the same locations that Find would look, and opens it. If Find returns an empty string, an error is returned.

TODO(ivucica): Support finding over HTTP.

func SetupFilePathFlag

func SetupFilePathFlag(fileName, flagName string, flagPtr *string)

SetupFilePathFlag creates a new string flag with the passed name with a sane default for the path to the file, if found using the Find function. If not, the flag defaults to an empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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