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

Function ensureAbs

internal/conf/utils.go:32–37  ·  view source on GitHub ↗

ensureAbs prepends the WorkDir to the given path if it is not an absolute path.

(path string)

Source from the content-addressed store, hash-verified

30
31// ensureAbs prepends the WorkDir to the given path if it is not an absolute path.
32func ensureAbs(path string) string {
33 if filepath.IsAbs(path) {
34 return path
35 }
36 return filepath.Join(WorkDir(), path)
37}
38
39// CheckRunUser returns false if configured run user does not match actual user that
40// runs the app. The first return value is the actual user name. This check is ignored

Callers 3

Test_ensureAbsFunction · 0.85
InitFunction · 0.85
initLogConfFunction · 0.85

Calls 1

WorkDirFunction · 0.85

Tested by 1

Test_ensureAbsFunction · 0.68