forked from go/pgm
removed file timestamping
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"golang.org/x/text/cases"
|
"golang.org/x/text/cases"
|
||||||
"golang.org/x/text/language"
|
"golang.org/x/text/language"
|
||||||
@@ -41,8 +40,9 @@ func generate(scheamPath, outDir string) error {
|
|||||||
|
|
||||||
// schema.go will hold all tables info
|
// schema.go will hold all tables info
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
sb.WriteString(fmt.Sprintf("// Code generated by code.patial.tech/go/pgm/cmd %s on %s DO NOT EDIT.\n\n",
|
sb.WriteString(
|
||||||
GetVersionString(), time.Now().Format("2006-01-02 15:04:05")))
|
fmt.Sprintf("// Code generated by code.patial.tech/go/pgm/cmd %s DO NOT EDIT.\n\n", GetVersionString()),
|
||||||
|
)
|
||||||
sb.WriteString(fmt.Sprintf("package %s \n", filepath.Base(outDir)))
|
sb.WriteString(fmt.Sprintf("package %s \n", filepath.Base(outDir)))
|
||||||
sb.WriteString(`
|
sb.WriteString(`
|
||||||
import "code.patial.tech/go/pgm"
|
import "code.patial.tech/go/pgm"
|
||||||
@@ -107,8 +107,9 @@ func generate(scheamPath, outDir string) error {
|
|||||||
|
|
||||||
func writeColFile(tblName string, cols []*Column, outDir string, caser cases.Caser) error {
|
func writeColFile(tblName string, cols []*Column, outDir string, caser cases.Caser) error {
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
sb.WriteString(fmt.Sprintf("// Code generated by code.patial.tech/go/pgm/cmd %s on %s DO NOT EDIT.\n\n",
|
sb.WriteString(
|
||||||
GetVersionString(), time.Now().Format("2006-01-02 15:04:05")))
|
fmt.Sprintf("// Code generated by code.patial.tech/go/pgm/cmd %s DO NOT EDIT.\n\n", GetVersionString()),
|
||||||
|
)
|
||||||
sb.WriteString(fmt.Sprintf("package %s\n\n", filepath.Base(outDir)))
|
sb.WriteString(fmt.Sprintf("package %s\n\n", filepath.Base(outDir)))
|
||||||
sb.WriteString(fmt.Sprintf("import %q\n\n", "code.patial.tech/go/pgm"))
|
sb.WriteString(fmt.Sprintf("import %q\n\n", "code.patial.tech/go/pgm"))
|
||||||
sb.WriteString("const (")
|
sb.WriteString("const (")
|
||||||
|
|||||||
Reference in New Issue
Block a user