Skip to content

Commit 5c75524

Browse files
committed
Updated logic of MakeComments to support models as pointers.
1 parent 2d7157a commit 5c75524

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

database/pgComment.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import (
1010
func MakeComments(ctx context.Context, sc SchemeCommenter, models ...interface{}) error {
1111
for _, model := range models {
1212
modelType := reflect.TypeOf(model)
13+
14+
if reflect.ValueOf(model).Kind() == reflect.Ptr {
15+
modelType = modelType.Elem()
16+
}
17+
1318
var tableName string
1419

1520
for i := 0; i < modelType.NumField(); i++ {

0 commit comments

Comments
 (0)