Remove unnecessary exported method

This commit is contained in:
Jinzhu 2013-11-15 13:30:31 +08:00
parent a343223ac5
commit e0b90d9770
3 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ func (s *Chain) err(err error) error {
}
func (s *Chain) hasError() bool {
return len(s.Errors) > 0
return s.Error != nil
}
func (s *Chain) deleteLastError() {

4
do.go
View File

@ -302,14 +302,14 @@ func (s *Do) last() {
}
func (s *Do) getForeignKey(from *Model, to *Model, foreign_key string) (err error, from_from bool, foreign_value interface{}) {
if has_column, is_slice, value := from.ColumnAndValue(foreign_key); has_column {
if has_column, is_slice, value := from.columnAndValue(foreign_key); has_column {
from_from = true
if is_slice {
foreign_value = to.primaryKeyValue()
} else {
foreign_value = value
}
} else if has_column, _, _ := to.ColumnAndValue(foreign_key); has_column {
} else if has_column, _, _ := to.columnAndValue(foreign_key); has_column {
foreign_value = from.primaryKeyValue()
} else {
err = errors.New("Can't find valid foreign Key")

View File

@ -151,7 +151,7 @@ func (m *Model) hasColumn(name string) bool {
return false
}
func (m *Model) ColumnAndValue(name string) (has_column bool, is_slice bool, value interface{}) {
func (m *Model) columnAndValue(name string) (has_column bool, is_slice bool, value interface{}) {
data := m.reflectData()
if data.Kind() == reflect.Struct {