File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -65,15 +65,15 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
6565 dst{ {classname} }{ {-index} } := & { {classname} }{ }
6666 err = json.Unmarshal(data, &dst{ {classname} }{ {-index} }.{ {#lambda.type-to-name} }{ {{.} }}{ {/lambda.type-to-name} })
6767 if err == nil {
68- json{{{. } }}, _ := json.Marshal(&dst{ {classname} }{ {-index} }.{ {#lambda.type-to-name} }{ {{.} }}{ {/lambda.type-to-name} })
68+ json{{#lambda.type-to-name } } { {{. } }} { {/lambda.type-to-name } }, _ := json.Marshal(&dst{ {classname} }{ {-index} }.{ {#lambda.type-to-name} }{ {{.} }}{ {/lambda.type-to-name} })
6969 { {#pattern} }
7070 regex := `{ {.} }`
7171 regex = regexp.MustCompile("^\\/|\\/$").ReplaceAllString(regex, "$1") // Remove beginning slash and ending slash
7272 regex = regexp.MustCompile("\\\\(.)").ReplaceAllString(regex, "$1") // Remove duplicate escaping char for dots
7373 rawString := regexp.MustCompile(`^"|"$`).ReplaceAllString(*dst{ {classname} }{ {-index} }.{ {#lambda.type-to-name} }{ {dataType} }{ {/lambda.type-to-name} }, "$1") // Remove quotes
7474 isMatched, _ := regexp.MatchString(regex, rawString)
7575 { {/pattern} }
76- if string(json{ {{. } }}) != "{ } " { {#pattern} }&& isMatched { {/pattern} } { // empty struct
76+ if string(json{ {#lambda.type-to-name } } { {{. } }} { {/lambda.type-to-name } }) != "{ } " { {#pattern} }&& isMatched { {/pattern} } { // empty struct
7777 dst.{{#lambda.type-to-name} }{ {{.} }}{ {/lambda.type-to-name} } = dst{ {classname} }{ {-index} }.{ {#lambda.type-to-name} }{ {{.} }}{ {/lambda.type-to-name} }
7878 match++
7979 }
You can’t perform that action at this time.
0 commit comments