We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4df4dc commit 390827eCopy full SHA for 390827e
orm/create_struct.go
@@ -98,7 +98,11 @@ func (q *Query[T]) CreateStruct(file ...string) error {
98
99
fileParts := strings.SplitN(fileContent, search, 2)
100
101
- finalFileContent := fileParts[0] + search + "\n" + strings.Join(structLines, "\n") + "\n}\n" + oldStructRename + fileParts[1]
+ finalFileContent := fileParts[0] + search + "\n" + strings.Join(structLines, "\n") + "\n}\n"
102
+
103
+ if len(fileParts) > 1 {
104
+ finalFileContent += oldStructRename + fileParts[1]
105
+ }
106
107
return ioutil.WriteFile(structFile, []byte(finalFileContent), 0644)
108
}
0 commit comments