浏览代码

bug fixed

xormplus 9 年之前
父节点
当前提交
aa15fd9816
共有 3 个文件被更改,包括 3 次插入17 次删除
  1. 0 15
      engine.go
  2. 1 1
      helpers.go
  3. 2 1
      xorm.go

+ 0 - 15
engine.go

@@ -1477,21 +1477,6 @@ func (engine *Engine) Query2(sql string, paramStr ...interface{}) (resultsSlice
 	return session.query2(sql, paramStr...)
 }
 
-//func XMLString(v interface{}, IndentXML bool) (string, error) {
-//	var result []byte
-//	var err error
-//	if IndentXML {
-//		result, err = xml.MarshalIndent(v, "", "  ")
-//	} else {
-//		result, err = xml.Marshal(v)
-//	}
-//	if err != nil {
-//		return "", err
-//	}
-
-//	return string(result), nil
-//}
-
 // Insert one or more records
 func (engine *Engine) Insert(beans ...interface{}) (int64, error) {
 	session := engine.NewSession()

+ 1 - 1
helpers.go

@@ -159,7 +159,7 @@ func isStructZero(v reflect.Value) bool {
 				return false
 			}
 		default:
-			if !isZero(field.Interface()) {
+			if field.CanInterface() && !isZero(field.Interface()) {
 				return false
 			}
 		}

+ 2 - 1
xorm.go

@@ -16,7 +16,8 @@ import (
 )
 
 const (
-	Version string = "0.5.4.0427"
+	// Version show the xorm's version
+	Version string = "0.5.4.0508"
 )
 
 func regDrvsNDialects() bool {