File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "html/template"
2828 "log"
2929 "os"
30+ "path"
3031 "reflect"
3132 "strings"
3233)
@@ -154,7 +155,7 @@ func (g *Generator) OutputToFile() {
154155 if err != nil {
155156 log .Fatal (err )
156157 }
157- fmt .Printf ("Generating Functional Options Code Successful .\n Out: %s\n " , g .outPath )
158+ fmt .Printf ("Generating Functional Options Code Successfully .\n Out: %s\n " , g .outPath )
158159}
159160
160161func (g * Generator ) forMart () []byte {
@@ -166,9 +167,10 @@ func (g *Generator) forMart() []byte {
166167}
167168
168169func (g * Generator ) SetOutPath (outPath * string ) {
170+ fileName := fmt .Sprintf ("opt_%s_gen.go" , stringx .CamelToSnake (g .StructInfo .StructName ))
169171 if len (* outPath ) > 0 {
170- g .outPath = * outPath
172+ g .outPath = path . Join ( * outPath , fileName )
171173 } else {
172- g .outPath = fmt . Sprintf ( "opt_%s_gen.go" , stringx . CamelToSnake ( g . StructInfo . StructName ))
174+ g .outPath = fileName
173175 }
174176}
You can’t perform that action at this time.
0 commit comments