MCPcopy
hub / github.com/containers/toolbox / getCurrentUserHomeDir

Function getCurrentUserHomeDir

src/cmd/utils.go:370–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

368}
369
370func getCurrentUserHomeDir() string {
371 if currentUser == nil {
372 panic("current user unknown")
373 }
374
375 userHomeDir, err := os.UserHomeDir()
376 if err == nil {
377 return userHomeDir
378 }
379
380 logrus.Debugf("Getting the current user's home directory: failed to use os.UserHomeDir(): %s", err)
381 logrus.Debug("Using user.Current() instead")
382
383 return currentUser.HomeDir
384}
385
386func getUsageForCommonCommands() string {
387 var builder strings.Builder

Callers 2

runCommandWithFallbacksFunction · 0.85
createContainerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…