When no database or config is found the program exits
All checks were successful
the build was successful
All checks were successful
the build was successful
This commit is contained in:
parent
5968e4e56e
commit
22ee38f7b4
2
main.go
2
main.go
|
@ -23,12 +23,14 @@ func main() {
|
|||
err := models.SetConfig()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Set Engine
|
||||
err = models.SetEngine()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Start the webserver
|
||||
|
|
|
@ -27,7 +27,7 @@ type ConfigStruct struct {
|
|||
var Config = new(ConfigStruct)
|
||||
|
||||
// SetConfig initianlises the config and publishes it for other functions to use
|
||||
func SetConfig() error {
|
||||
func SetConfig() (err error) {
|
||||
|
||||
// File Checks
|
||||
if _, err := os.Stat("config.ini"); os.IsNotExist(err) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user