Skip to content

Commit

Permalink
fix more whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
arjendevos committed May 20, 2022
1 parent 13a66ff commit 7894040
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sqlboiler_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func parseViews(dir string) []string {

var (
enumRegex = regexp.MustCompile(`// Enum values for (.*)\nconst\s\(\n(:?(.|\n)*?)\n\)`) //nolint:gochecknoglobals
enumValuesRegex = regexp.MustCompile(`\s(\w+) string\s*=\s*"(\w+)"`) //nolint:gochecknoglobals
enumValuesRegex = regexp.MustCompile(`\s(\w+)\s*string\s*=\s*"(\w+)"`) //nolint:gochecknoglobals
)

func parseEnums(dir string, allTableNames []string) []*BoilerEnum {
Expand All @@ -394,16 +394,17 @@ func parseEnums(dir string, allTableNames []string) []*BoilerEnum {
}
matches := enumRegex.FindAllStringSubmatch(string(content), -1)
a := make([]*BoilerEnum, len(matches))
fmt.Println(a)
for i, match := range matches {
// 1: messageLetterStatus
// 2: status
// 3: contents

fmt.Println(match)
modelName, fieldKey := stripLastWord(match[1], allTableNames)
name := strcase.ToCamel(match[1])
// fmt.Println("name", match[1])
// fmt.Println("modelName", modelName)
// fmt.Println("fieldKey", fieldKey)
fmt.Println("name", match[1])
fmt.Println("modelName", modelName)
fmt.Println("fieldKey", fieldKey)

a[i] = &BoilerEnum{
Name: name,
Expand Down Expand Up @@ -445,7 +446,7 @@ func parseEnumValues(content string) []*BoilerEnumValue {
// 2: status
// 2: status
// 3: contents

fmt.Println(" name =", match[1])
a[i] = &BoilerEnumValue{
Name: match[1],
}
Expand Down

0 comments on commit 7894040

Please sign in to comment.