MCPcopy Create free account
hub / github.com/docker/cli / expandUser

Function expandUser

cli/compose/loader/loader.go:513–523  ·  view source on GitHub ↗

TODO: make this more robust

(srcPath string, lookupEnv template.Mapping)

Source from the content-addressed store, hash-verified

511
512// TODO: make this more robust
513func expandUser(srcPath string, lookupEnv template.Mapping) string {
514 if strings.HasPrefix(srcPath, "~") {
515 home, ok := lookupEnv("HOME")
516 if !ok {
517 logrus.Warn("cannot expand '~', because the environment lacks HOME")
518 return srcPath
519 }
520 return strings.Replace(srcPath, "~", home, 1)
521 }
522 return srcPath
523}
524
525func transformUlimits(data any) (any, error) {
526 switch value := data.(type) {

Callers 1

resolveVolumePathsFunction · 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…