appdata

package
v1.9.16 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check added in v1.9.16

func Check(err error) bool

func Debug added in v1.9.16

func Debug(a ...interface{})

func Debugc added in v1.9.16

func Debugc(fn func() string)

func Debugf added in v1.9.16

func Debugf(format string, a ...interface{})

func Debugs added in v1.9.16

func Debugs(a interface{})

func Dir

func Dir(appName string, roaming bool) string

Dir returns an operating system specific directory to be used for storing application data for an application. The appName parameter is the name of the application the data directory is being requested for. This function will prepend a period to the appName for POSIX style operating systems since that is standard practice.

An empty appName or one with a single dot is treated as requesting the current directory so only "." will be returned. Further, the first character of appName will be made lowercase for POSIX style operating systems and uppercase for Mac and Windows since that is standard practice.

The roaming parameter only applies to Windows where it specifies the roaming application data profile (%APPDATA%) should be used instead of the local one (%LOCALAPPDATA%) that is used by default. Example results:

dir := Dir("myapp", false)

 POSIX (Linux/BSD): ~/.myapp
 Mac OS: $HOME/Library/Application Support/Myapp
 Windows: %LOCALAPPDATA%\Myapp
 Plan 9: $home/myapp

func Error added in v1.9.16

func Error(a ...interface{})

func Errorc added in v1.9.16

func Errorc(fn func() string)

func Errorf added in v1.9.16

func Errorf(format string, a ...interface{})

func Errors added in v1.9.16

func Errors(a interface{})

func Fatal added in v1.9.16

func Fatal(a ...interface{})

func Fatalc added in v1.9.16

func Fatalc(fn func() string)

func Fatalf added in v1.9.16

func Fatalf(format string, a ...interface{})

func Fatals added in v1.9.16

func Fatals(a interface{})

func GetDataDir added in v0.4.16

func GetDataDir(goos, appName string, roaming bool) string

GetDataDir returns an operating system specific directory to be used for storing application data for an application. See Dir for more details. This unexported version takes an operating system argument primarily to enable the testing package to properly test the function by forcing an operating system that is not the currently one.

func Info added in v1.9.16

func Info(a ...interface{})

func Infoc added in v1.9.16

func Infoc(fn func() string)

func Infof added in v1.9.16

func Infof(format string, a ...interface{})

func Infos added in v1.9.16

func Infos(a interface{})

func Trace added in v1.9.16

func Trace(a ...interface{})

func Tracec added in v1.9.16

func Tracec(fn func() string)

func Tracef added in v1.9.16

func Tracef(format string, a ...interface{})

func Traces added in v1.9.16

func Traces(a interface{})

func Warn added in v1.9.16

func Warn(a ...interface{})

func Warnc added in v1.9.16

func Warnc(fn func() string)

func Warnf added in v1.9.16

func Warnf(format string, a ...interface{})

func Warns added in v1.9.16

func Warns(a interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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