MCPcopy Index your code
hub / github.com/linuxkit/linuxkit / readConfig

Function readConfig

src/cmd/linuxkit/cmd.go:30–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30func readConfig() {
31 cfgPath := filepath.Join(os.Getenv("HOME"), ".moby", "linuxkit", "config.yml")
32 cfgBytes, err := os.ReadFile(cfgPath)
33 if err != nil {
34 if os.IsNotExist(err) {
35 return
36 }
37 fmt.Printf("Failed to read %q\n", cfgPath)
38 os.Exit(1)
39 }
40 if err := yaml.Unmarshal(cfgBytes, &Config); err != nil {
41 fmt.Printf("Failed to parse %q\n", cfgPath)
42 os.Exit(1)
43 }
44}
45
46func newCmd() *cobra.Command {
47 var (

Callers 1

newCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected