From 15583e60171ec9e971205576c2afe8fb04cf7d3b Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 28 Jan 2014 16:29:42 +0800 Subject: [PATCH] rename some files --- sql.go => interface.go | 0 private.go => main_private.go | 4 ---- scope.go | 6 +++++- scope_condition.go | 4 ---- 4 files changed, 5 insertions(+), 9 deletions(-) rename sql.go => interface.go (100%) rename private.go => main_private.go (94%) diff --git a/sql.go b/interface.go similarity index 100% rename from sql.go rename to interface.go diff --git a/private.go b/main_private.go similarity index 94% rename from private.go rename to main_private.go index 2b6bceb0..fe198c1d 100644 --- a/private.go +++ b/main_private.go @@ -40,10 +40,6 @@ func (s *DB) err(err error) error { return err } -func (s *DB) hasError() bool { - return s.Error != nil -} - func (s *DB) print(v ...interface{}) { s.parent.logger.(logger).Print(v...) } diff --git a/scope.go b/scope.go index d73ddb10..5ea82983 100644 --- a/scope.go +++ b/scope.go @@ -24,6 +24,10 @@ type Scope struct { skipLeft bool } +func (scope *Scope) Quote(str string) string { + return scope.Dialect().Quote(str) +} + func (db *DB) NewScope(value interface{}) *Scope { db.Value = value return &Scope{db: db, Search: db.search, Value: value, _values: map[string]interface{}{}} @@ -71,7 +75,7 @@ func (scope *Scope) Log(v ...interface{}) { } func (scope *Scope) HasError() bool { - return scope.db.hasError() + return scope.db.Error != nil } func (scope *Scope) PrimaryKey() string { diff --git a/scope_condition.go b/scope_condition.go index fd820c8f..21f6d5a8 100644 --- a/scope_condition.go +++ b/scope_condition.go @@ -10,10 +10,6 @@ import ( "strings" ) -func (scope *Scope) Quote(str string) string { - return scope.Dialect().Quote(str) -} - func (scope *Scope) primaryCondiation(value interface{}) string { return fmt.Sprintf("(%v = %v)", scope.Quote(scope.PrimaryKey()), value) }