Browse Source

Messages, clean code comments

Vova Tkach 5 years ago
parent
commit
5b03f6e25d
2 changed files with 7 additions and 5 deletions
  1. 5 5
      main.go
  2. 2 0
      support/support.go

+ 5 - 5
main.go

@@ -52,11 +52,11 @@ func main() {
 	}
 	}
 
 
 	// Run database migration
 	// Run database migration
-	// TODO: something need here for migration
-	// Something for context
-	ctx := context.Background()
-	if err := support.New().Migration(ctx, consts.ParamWwwDir); err != nil {
-		fmt.Printf("[ERROR] MIGRATION FAILED: %s\n", err)
+	if err := support.New().
+		Migration(context.Background(), consts.ParamWwwDir); err != nil {
+		fmt.Printf("[MIGRATION] FAILED: %s\n", err)
+	} else {
+		fmt.Printf("[MIGRATION] DONE!\n")
 	}
 	}
 
 
 	// Init logger
 	// Init logger

+ 2 - 0
support/support.go

@@ -2,6 +2,7 @@ package support
 
 
 import (
 import (
 	"context"
 	"context"
+	"fmt"
 	"io/ioutil"
 	"io/ioutil"
 	"os"
 	"os"
 	"regexp"
 	"regexp"
@@ -33,6 +34,7 @@ func (this *Support) isSettingsTableDoesntExist(err error) bool {
 }
 }
 
 
 func (this *Support) Migration(ctx context.Context, dir string) error {
 func (this *Support) Migration(ctx context.Context, dir string) error {
+	fmt.Printf("[MIGRATION] PLEASE WAIT UNTIL THIS WILL BE DONE!\n")
 	files, err := ioutil.ReadDir(dir)
 	files, err := ioutil.ReadDir(dir)
 	if err != nil {
 	if err != nil {
 		return err
 		return err