From 3c3c2f93cc29437605205f174a7f7d1a85a60a2d Mon Sep 17 00:00:00 2001 From: biless Date: Thu, 18 May 2017 09:59:34 +0800 Subject: [PATCH] fix insert nil pk in pg --- helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helpers.go b/helpers.go index c9582365..bac1fd9c 100644 --- a/helpers.go +++ b/helpers.go @@ -554,6 +554,10 @@ func genCols(table *core.Table, session *Session, bean interface{}, useCol bool, if len(fieldValue.String()) == 0 { continue } + case reflect.Ptr: + if fieldValue.Pointer() == 0 { + continue + } } }