MCPcopy Create free account
hub / github.com/gogs/gogs / AppPath

Function AppPath

internal/conf/computed.go:30–45  ·  view source on GitHub ↗

AppPath returns the absolute path of the application's binary.

()

Source from the content-addressed store, hash-verified

28
29// AppPath returns the absolute path of the application's binary.
30func AppPath() string {
31 appPathOnce.Do(func() {
32 var err error
33 appPath, err = exec.LookPath(os.Args[0])
34 if err != nil {
35 panic("look executable path: " + err.Error())
36 }
37
38 appPath, err = filepath.Abs(appPath)
39 if err != nil {
40 panic("get absolute executable path: " + err.Error())
41 }
42 })
43
44 return appPath
45}
46
47var (
48 workDir string

Callers 4

createDelegateHooksFunction · 0.92
AuthorizedStringMethod · 0.92
handleServerConnFunction · 0.92
WorkDirFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected