Skip to content

Commit

Permalink
Fix some linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Oct 29, 2018
1 parent b18f90f commit b244bf4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ warningCode = 0
[rule.error-return]
[rule.error-strings]
[rule.error-naming]
[rule.exported]
[rule.if-return]
[rule.increment-decrement]
[rule.var-naming]
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/driver/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"database/sql"
"fmt"
"github.com/clivern/beaver/internal/pkg/logger"
_ "github.com/go-sql-driver/mysql"
//_ "github.com/go-sql-driver/mysql"
)

// MySQL
// MySQL driver
type MySQL struct {
Username string
Password string
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/driver/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
package driver

import (
_ "github.com/go-redis/redis"
//_ "github.com/go-redis/redis"
)

// Redis
// Redis driver
type Redis struct {
}
1 change: 1 addition & 0 deletions internal/pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/google/logger"
)

// LogsPath defines where we store logs
const LogsPath = "var/logs"

// Info log
Expand Down
4 changes: 4 additions & 0 deletions internal/pkg/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
)

// Config util
type Config struct {
AppMode string `json:"app_mode"`
AppPort string `json:"app_port"`
Expand All @@ -24,6 +25,7 @@ type Config struct {
MySQLDatabase string `json:"mysql_database"`
}

// Load method loads configs from json file
func (e *Config) Load(file string) (bool, error) {

_, err := os.Stat(file)
Expand All @@ -47,6 +49,7 @@ func (e *Config) Load(file string) (bool, error) {
return true, nil
}

// Cache stores configs on env vars
func (e *Config) Cache() {
if os.Getenv("AppMode") == "" {
os.Setenv("AppMode", e.AppMode)
Expand All @@ -62,6 +65,7 @@ func (e *Config) Cache() {
}
}

// GinEnv will store gin port on env var
func (e *Config) GinEnv() {
// Used by gin framework
// https://github.com/gin-gonic/gin/blob/d510595aa58c2417373d89a8d8ffa21cf58673cb/utils.go#L140
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"github.com/satori/go.uuid"
)

// Generate UUID
// GenerateUUID create a UUID
func GenerateUUID() string {
u := uuid.Must(uuid.NewV4())
return u.String()
}

// Print Banner
// PrintBanner add a banner to app
func PrintBanner() {
fmt.Print("\033[31m")
fmt.Print(`
Expand Down

0 comments on commit b244bf4

Please sign in to comment.