Skip to content

Commit 2234744

Browse files
authored
Merge pull request #34 from Shelnutt2/issue-33
Fix including primary_key with json tags
2 parents 0eb70da + b765416 commit 2234744

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils_mysql.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func generateMysqlTypes(obj map[string]map[string]string, depth int, jsonAnnotat
9595
annotations = append(annotations, fmt.Sprintf("gorm:\"column:%s%s\"", key, primary))
9696
}
9797
if jsonAnnotation == true {
98-
annotations = append(annotations, fmt.Sprintf("json:\"%s%s\"", key, primary))
98+
annotations = append(annotations, fmt.Sprintf("json:\"%s\"", key))
9999
}
100100
if len(annotations) > 0 {
101101
structure += fmt.Sprintf("\n%s %s `%s`",

0 commit comments

Comments
 (0)