Browse Source

fix lints

pull/6/head
Lunny Xiao 5 months ago
parent
commit
87cf7611cd
Signed by: lunny <xiaolunwen@gmail.com> GPG Key ID: C3B7C91B632F738A
4 changed files with 10 additions and 6 deletions
  1. +2
    -6
      cmd/reverse.go
  2. +2
    -0
      cmd/root.go
  3. +1
    -0
      language/language.go
  4. +5
    -0
      main.go

+ 2
- 6
cmd/reverse.go View File

@@ -16,11 +16,7 @@ import (
"xorm.io/reverse/language"

"gitea.com/lunny/log"
_ "github.com/denisenkom/go-mssqldb"
_ "github.com/go-sql-driver/mysql"
"github.com/gobwas/glob"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
"gopkg.in/yaml.v2"
"xorm.io/core"
"xorm.io/xorm"
@@ -47,6 +43,7 @@ func reverse(rFile string) error {
return nil
}

// ReverseSource represents a reverse source which should be a database connection
type ReverseSource struct {
Database string `yaml:"database"`
ConnStr string `yaml:"conn_str"`
@@ -96,9 +93,8 @@ func unTitle(src string) string {

if len(src) == 1 {
return strings.ToLower(string(src[0]))
} else {
return strings.ToLower(string(src[0])) + src[1:]
}
return strings.ToLower(string(src[0])) + src[1:]
}

func upTitle(src string) string {


+ 2
- 0
cmd/root.go View File

@@ -11,6 +11,7 @@ import (
)

var (
// Version means the version of reverse
Version = "0.1+dev"

reverseFile string
@@ -44,6 +45,7 @@ func init() {
rootCmd.Flags().StringVarP(&reverseFile, "file", "f", "", "yml file to apply for reverse")
}

// Execute represnets execute command
func Execute() error {
return rootCmd.Execute()
}

+ 1
- 0
language/language.go View File

@@ -25,6 +25,7 @@ var (
languages = make(map[string]*Language)
)

// RegisterLanguage registers a language
func RegisterLanguage(l *Language) {
languages[l.Name] = l
}


+ 5
- 0
main.go View File

@@ -8,6 +8,11 @@ import (
"fmt"

"xorm.io/reverse/cmd"

_ "github.com/denisenkom/go-mssqldb"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
)

func main() {


Loading…
Cancel
Save