gen

command module
v0.0.0-...-7656b27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: GPL-3.0 Imports: 19 Imported by: 0

README

Important

This project was forked from smallnest/gen. Removes table name and struct singular. The origin project is db2struct git diff:

--- a/main.go
+++ b/main.go
@@ -110,7 +110,6 @@ func main() {
        // generate go files for each table
        for _, tableName := range tables {
                structName := dbmeta.FmtFieldName(tableName)
-               structName = inflection.Singular(structName)
                structNames = append(structNames, structName)

                modelInfo := dbmeta.GenerateStruct(db, tableName, structName, "model", *jsonAnnotation, *gormAnnotation, *gureguTypes)
@@ -126,7 +125,7 @@ func main() {
                        fmt.Println("Error in formating source: " + err.Error())
                        return
                }
-               ioutil.WriteFile(filepath.Join("model", inflection.Singular(tableName)+".go"), data, 0777)
+               ioutil.WriteFile(filepath.Join("model", tableName+".go"), data, 0777)

                if *rest {
                        //write api

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL