susumu.yata
null+****@clear*****
Wed Jun 24 09:56:10 JST 2015
susumu.yata 2015-06-24 09:56:10 +0900 (Wed, 24 Jun 2015) New Revision: 6938720d0bc322917859f9ceb667a4af7f74adef https://github.com/groonga/grngo/commit/6938720d0bc322917859f9ceb667a4af7f74adef Message: Apply go fmt. Modified files: grngo.go grngo_test.go Modified: grngo.go (+4 -4) =================================================================== --- grngo.go 2015-06-24 09:55:13 +0900 (f35dafd) +++ grngo.go 2015-06-24 09:56:10 +0900 (85f4571) @@ -25,8 +25,8 @@ import ( // GeoPoint represents a coordinate of latitude and longitude. type GeoPoint struct { - Latitude int32 // Latitude in milliseconds. - Longitude int32 // Longitude in milliseconds. + Latitude int32 // Latitude in milliseconds. + Longitude int32 // Longitude in milliseconds. } // NilID is an invalid record ID. @@ -709,8 +709,8 @@ func (table *Table) CreateColumn(name string, valueType string, optionsMap["table"] = table.name optionsMap["name"] = name if strings.HasPrefix(valueType, "[]") { - valueType = valueType[2:] - optionsMap["flags"] = "COLUMN_VECTOR" + valueType = valueType[2:] + optionsMap["flags"] = "COLUMN_VECTOR" } else if delimPos := strings.IndexByte(valueType, '.'); delimPos != -1 { optionsMap["source"] = valueType[delimPos:] valueType = valueType[:delimPos] Modified: grngo_test.go (+7 -7) =================================================================== --- grngo_test.go 2015-06-24 09:55:13 +0900 (976d03b) +++ grngo_test.go 2015-06-24 09:56:10 +0900 (92be847) @@ -236,7 +236,7 @@ func TestDBCreateTableWithShortTextRefValue(t *testing.T) { func generateRandomKey(keyType string) interface{} { switch keyType { case "Bool": - return (rand.Int() & 1) == 1 + return (rand.Int() & 1) == 1 case "Int8": return int64(int8(rand.Int())) case "Int16": @@ -376,7 +376,7 @@ func testTableCreateScalarColumn(t *testing.T, valueType string) { func testTableCreateVectorColumn(t *testing.T, valueType string) { dirPath, _, db, table, _ := - createTempColumn(t, "Table", nil, "Value", "[]" + valueType, nil) + createTempColumn(t, "Table", nil, "Value", "[]"+valueType, nil) defer removeTempDB(t, dirPath, db) if column, err := table.FindColumn("_id"); err != nil { @@ -731,7 +731,7 @@ func testColumnSetValueForScalar(t *testing.T, valueType string) { func testColumnSetValueForVector(t *testing.T, valueType string) { dirPath, _, db, table, column := - createTempColumn(t, "Table", nil, "Value", "[]" + valueType, nil) + createTempColumn(t, "Table", nil, "Value", "[]"+valueType, nil) defer removeTempDB(t, dirPath, db) for i := 0; i < 100; i++ { @@ -901,7 +901,7 @@ func testColumnGetValueForScalar(t *testing.T, valueType string) { func testColumnGetValueForVector(t *testing.T, valueType string) { dirPath, _, db, table, column := - createTempColumn(t, "Table", nil, "Value", "[]" + valueType, nil) + createTempColumn(t, "Table", nil, "Value", "[]"+valueType, nil) defer removeTempDB(t, dirPath, db) for i := 0; i < 100; i++ { @@ -1104,7 +1104,7 @@ func benchmarkColumnSetValueForVector(b *testing.B, valueType string) { } for i := 0; i < b.N; i++ { - column, err := table.CreateColumn(fmt.Sprintf("V%d", i), "[]" + valueType, nil) + column, err := table.CreateColumn(fmt.Sprintf("V%d", i), "[]"+valueType, nil) if err != nil { b.Fatalf("Table.CreateColumn() failed(): %s", err) } @@ -1219,7 +1219,7 @@ func benchmarkColumnGetValueForScalar(b *testing.B, valueType string) { func benchmarkColumnGetValueForVector(b *testing.B, valueType string) { dirPath, _, db, table, column := - createTempColumn(b, "Table", nil, "Value", "[]" + valueType, nil) + createTempColumn(b, "Table", nil, "Value", "[]"+valueType, nil) defer removeTempDB(b, dirPath, db) ids := make([]uint32, numTestRows) for i, _ := range ids { @@ -1342,7 +1342,7 @@ func benchmarkDBSelectForScalar(b *testing.B, valueType string) { func benchmarkDBSelectForVector(b *testing.B, valueType string) { dirPath, _, db, table, column := - createTempColumn(b, "Table", nil, "Value", "[]" + valueType, nil) + createTempColumn(b, "Table", nil, "Value", "[]"+valueType, nil) defer removeTempDB(b, dirPath, db) ids := make([]uint32, numTestRows) for i, _ := range ids { -------------- next part -------------- HTML����������������������������...Download