susumu.yata
null+****@clear*****
Wed Jun 24 12:46:01 JST 2015
susumu.yata 2015-06-24 12:46:01 +0900 (Wed, 24 Jun 2015) New Revision: 8ad08e73d0240e82127fc208fb85411cb706e913 https://github.com/groonga/grngo/commit/8ad08e73d0240e82127fc208fb85411cb706e913 Message: Update comments for InsertRow(). GitHub: #8 Modified files: grngo.go Modified: grngo.go (+4 -8) =================================================================== --- grngo.go 2015-06-24 12:38:28 +0900 (102c87f) +++ grngo.go 2015-06-24 12:46:01 +0900 (4fff250) @@ -526,9 +526,8 @@ func (db *DB) FindTable(name string) (*Table, error) { return table, nil } -// TODO: responses should be named. -// InsertRow inserts a row. -func (db *DB) InsertRow(tableName string, key interface{}) (bool, uint32, error) { +// InsertRow finds or inserts a row. +func (db *DB) InsertRow(tableName string, key interface{}) (inserted bool, id uint32, err error) { table, err := db.FindTable(tableName) if err != nil { return false, NilID, err @@ -698,11 +697,8 @@ func (table *Table) insertText(key []byte) (bool, uint32, error) { return rowInfo.inserted == C.GRN_TRUE, uint32(rowInfo.id), nil } -// TODO: responses should be named. -// InsertRow inserts a row. -// The first return value specifies whether a row is inserted or not. -// The second return value is the ID of the inserted or found row. -func (table *Table) InsertRow(key interface{}) (bool, uint32, error) { +// InsertRow finds or inserts a row. +func (table *Table) InsertRow(key interface{}) (inserted bool, id uint32, err error) { switch value := key.(type) { case nil: return table.insertVoid() -------------- next part -------------- HTML����������������������������...Download