@@ -29,13 +29,13 @@ var (
2929 Envar (getEnVar (EnVarConfigFile )).
3030 Short ('c' ).String ()
3131
32- //Server commands
33- //Server start
32+ // Server commands
33+ // Server start
3434 serverCmd = app .Command ("server" , "Commands for the server" )
3535 serverCmdStart = serverCmd .Command ("start" , "Start the server" )
3636
37- //Config commands
38- //Config create
37+ // Config commands
38+ // Config create
3939 configCmd = app .Command ("config" , "Commands for the config file" )
4040 configCmdCreate = configCmd .Command ("create" , "Create config file" )
4141 configCmdCreateName = configCmdCreate .Arg ("name" , "Config filename" ).Default (models .GetDefaultConfig ()).String ()
@@ -46,46 +46,46 @@ var (
4646 db * gorm.DB
4747)
4848
49- //Env vars
49+ // Env vars
5050const (
51- //EnVarPrefix prefix of all used env vars
51+ // EnVarPrefix prefix of all used env vars
5252 EnVarPrefix = "DM"
5353
5454 EnVarLogLevel = "LOG_LEVEL"
5555 EnVarNoColor = "NO_COLOR"
5656 EnVarConfigFile = "CONFIG"
5757)
5858
59- //Return the variable using the server prefix
59+ // Return the variable using the server prefix
6060func getEnVar (name string ) string {
6161 return fmt .Sprintf ("%s_%s" , EnVarPrefix , name )
6262}
6363
6464func main () {
65- //Set app attributes
65+ // Set app attributes
6666 app .HelpFlag .Short ('h' )
6767 app .Version (version )
6868
69- //parsing the args
69+ // Parsing the args
7070 parsed := kingpin .MustParse (app .Parse (os .Args [1 :]))
7171
7272 setupLogger ()
7373
7474 log .Infof ("LogLevel: %s\n " , * appLogLevel )
7575
76- //set app logLevel
76+ // Set app logLevel
7777 switch * appLogLevel {
7878 case constants .LogLevels [0 ]:
79- //Debug
79+ // Debug
8080 log .SetLevel (log .DebugLevel )
8181 case constants .LogLevels [1 ]:
82- //Info
82+ // Info
8383 log .SetLevel (log .InfoLevel )
8484 case constants .LogLevels [2 ]:
85- //Warning
85+ // Warning
8686 log .SetLevel (log .WarnLevel )
8787 case constants .LogLevels [3 ]:
88- //Error
88+ // Error
8989 log .SetLevel (log .ErrorLevel )
9090 default :
9191 fmt .Println ("LogLevel not found!" )
@@ -109,14 +109,14 @@ func main() {
109109
110110 var err error
111111
112- //connect db
112+ // Connect db
113113 db , err = storage .ConnectToDatabase (config )
114114 if err != nil {
115115 log .Fatalln (err )
116116 return
117117 }
118118
119- //Check if connected to db
119+ // Check if connected to db
120120 if isConnected , err := storage .CheckConnection (db ); ! isConnected {
121121 log .Fatalln (err )
122122 return
@@ -125,16 +125,16 @@ func main() {
125125 log .Debug ("Successfully connected to DB" )
126126 }
127127
128- //Init gaw random seed
128+ // Init gaw random seed
129129 gaw .Init ()
130130
131131 switch parsed {
132- //Server --------------------
132+ // Server --------------------
133133 case serverCmdStart .FullCommand ():
134134 {
135135 startAPI ()
136136 }
137- //Config --------------------
137+ // Config --------------------
138138 case configCmdCreate .FullCommand ():
139139 {
140140 models .InitConfig (* configCmdCreateName , true )
0 commit comments