MCPcopy Create free account
hub / github.com/cloudwan/gohan / LoadConfig

Function LoadConfig

db/migration/migration.go:111–128  ·  view source on GitHub ↗

LoadConfig loads config from config file

(configFile string)

Source from the content-addressed store, hash-verified

109
110// LoadConfig loads config from config file
111func LoadConfig(configFile string) (err error) {
112 config := util.GetConfig()
113
114 err = config.ReadConfig(configFile)
115
116 if err != nil {
117 fmt.Printf("error: failed to load config: %s\n", err)
118 return
119 }
120
121 err = os.Chdir(path.Dir(configFile))
122 if err != nil {
123 fmt.Printf("error: chdir() failed: %s\n", err)
124 return
125 }
126
127 return
128}
129
130func readGooseConfig() (dbType, dbConnection, migrationsPath string, noInit bool) {
131 config := util.GetConfig()

Callers

nothing calls this directly

Calls 2

ReadConfigMethod · 0.80
DirMethod · 0.80

Tested by

no test coverage detected