From d699c85486c526c9bdce57f4bd8b7343b61132c6 Mon Sep 17 00:00:00 2001 From: Benjamin Ruston Date: Mon, 4 Aug 2014 19:54:05 +0100 Subject: [PATCH] Use fmt.Errorf --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4df38ff0..951f989a 100644 --- a/main.go +++ b/main.go @@ -367,10 +367,10 @@ func (s *DB) Association(column string) *Association { if f, ok := scopeType.FieldByName(SnakeToUpperCamel(column)); ok { field = scope.fieldFromStruct(f) if field.Relationship == nil || field.Relationship.ForeignKey == "" { - scope.Err(errors.New(fmt.Sprintf("invalid association %v for %v", column, scopeType))) + scope.Err(fmt.Errorf("invalid association %v for %v", column, scopeType)) } } else { - scope.Err(errors.New(fmt.Sprintf("%v doesn't have column %v", scopeType, column))) + scope.Err(fmt.Errorf("%v doesn't have column %v", scopeType, column)) } return &Association{Scope: scope, Column: column, Error: s.Error, PrimaryKey: primaryKey, Field: field}