[Groonga-commit] groonga/grnci at 8ea703b [master] Change the comment format

Back to archive index

Susumu Yata null+****@clear*****
Thu Feb 18 17:42:01 JST 2016


Susumu Yata	2016-02-18 17:42:01 +0900 (Thu, 18 Feb 2016)

  New Revision: 8ea703b1e6b9155dd07e00149ef39ec5877db1e4
  https://github.com/groonga/grnci/commit/8ea703b1e6b9155dd07e00149ef39ec5877db1e4

  Message:
    Change the comment format

  Modified files:
    db.go
    grnci.go
    grnci_test.go

  Modified: db.go (+26 -26)
===================================================================
--- db.go    2016-02-18 17:29:11 +0900 (b9b34f5)
+++ db.go    2016-02-18 17:42:01 +0900 (bccf462)
@@ -24,7 +24,7 @@ type refCount struct {
 	mutex sync.Mutex // Mutex for the reference count.
 }
 
-// newRefCount() creates a reference counter.
+// newRefCount creates a reference counter.
 func newRefCount() *refCount {
 	return &refCount{}
 }
@@ -39,8 +39,8 @@ type DB struct {
 	port int        // Server port number (connection).
 }
 
-// newDB() creates an instance of DB.
-// The instance must be finalized by DB.fin().
+// newDB creates an instance of DB.
+// The instance must be finalized by DB.fin.
 func newDB() (*DB, error) {
 	if err := grnInit(); err != nil {
 		return nil, err
@@ -54,7 +54,7 @@ func newDB() (*DB, error) {
 	return &db, nil
 }
 
-// fin() finalizes an instance of DB.
+// fin finalizes an instance of DB.
 func (db *DB) fin() error {
 	if db == nil {
 		return fmt.Errorf("db is nil")
@@ -87,7 +87,7 @@ func (db *DB) fin() error {
 	return nil
 }
 
-// Errorf() creates an error.
+// errorf creates an error.
 func (db *DB) errorf(format string, args ...interface{}) error {
 	msg := fmt.Sprintf(format, args...)
 	if (db == nil) || (db.ctx == nil) || (db.ctx.rc == C.GRN_SUCCESS) {
@@ -97,17 +97,17 @@ func (db *DB) errorf(format string, args ...interface{}) error {
 	return fmt.Errorf("%s: ctx.rc = %s, ctx.errbuf = %s", msg, db.ctx.rc, ctxMsg)
 }
 
-// IsHandle() returns whether db is a handle.
+// IsHandle returns whether db is a handle.
 func (db *DB) IsHandle() bool {
 	return (db != nil) && (db.obj != nil)
 }
 
-// IsConnection() returns whether db is a connection.
+// IsConnection returns whether db is a connection.
 func (db *DB) IsConnection() bool {
 	return (db != nil) && (len(db.host) != 0)
 }
 
-// Path() returns the database path if db is a handle.
+// Path returns the database path if db is a handle.
 // Otherwise, it returns "".
 func (db *DB) Path() string {
 	if db == nil {
@@ -116,7 +116,7 @@ func (db *DB) Path() string {
 	return db.path
 }
 
-// Host() returns the server host name if db is a connection.
+// Host returns the server host name if db is a connection.
 // Otherwise, it returns "".
 func (db *DB) Host() string {
 	if db == nil {
@@ -125,7 +125,7 @@ func (db *DB) Host() string {
 	return db.host
 }
 
-// Port() returns the server port number if db is a connection.
+// Port returns the server port number if db is a connection.
 // Otherwise, it returns 0.
 func (db *DB) Port() int {
 	if db == nil {
@@ -134,7 +134,7 @@ func (db *DB) Port() int {
 	return db.port
 }
 
-// check() returns an error if db is invalid.
+// check returns an error if db is invalid.
 func (db *DB) check() error {
 	if db == nil {
 		return fmt.Errorf("db is nil")
@@ -148,8 +148,8 @@ func (db *DB) check() error {
 	return nil
 }
 
-// Create() creates a database and returns a handle to it.
-// The handle must be closed by DB.Close().
+// Create creates a database and returns a handle to it.
+// The handle must be closed by DB.Close.
 func Create(path string) (*DB, error) {
 	if len(path) == 0 {
 		return nil, fmt.Errorf("path is empty")
@@ -176,8 +176,8 @@ func Create(path string) (*DB, error) {
 	return db, nil
 }
 
-// Open() opens a database and returns a handle to it.
-// The handle must be closed by DB.Close().
+// Open opens a database and returns a handle to it.
+// The handle must be closed by DB.Close.
 func Open(path string) (*DB, error) {
 	if len(path) == 0 {
 		return nil, fmt.Errorf("path is empty")
@@ -204,8 +204,8 @@ func Open(path string) (*DB, error) {
 	return db, nil
 }
 
-// Connect() establishes a connection to a server.
-// The connection must be closed by DB.Close().
+// Connect establishes a connection to a server.
+// The connection must be closed by DB.Close.
 func Connect(host string, port int) (*DB, error) {
 	if len(host) == 0 {
 		return nil, fmt.Errorf("host is empty")
@@ -226,8 +226,8 @@ func Connect(host string, port int) (*DB, error) {
 	return db, nil
 }
 
-// Dup() duplicates a handle or a connection.
-// The handle or connection must be closed by DB.Close().
+// Dup duplicates a handle or a connection.
+// The handle or connection must be closed by DB.Close.
 func (db *DB) Dup() (*DB, error) {
 	if err := db.check(); err != nil {
 		return nil, err
@@ -252,7 +252,7 @@ func (db *DB) Dup() (*DB, error) {
 	return dupDB, nil
 }
 
-// Close() closes a handle or a connection.
+// Close closes a handle or a connection.
 func (db *DB) Close() error {
 	if err := db.check(); err != nil {
 		return err
@@ -264,7 +264,7 @@ func (db *DB) Close() error {
 // Low-level command interface
 //
 
-// checkCmdName() checks whether a string is valid as a command name.
+// checkCmdName checks whether a string is valid as a command name.
 func checkCmdName(s string) error {
 	if len(s) == 0 {
 		return fmt.Errorf("command name must not be empty")
@@ -280,7 +280,7 @@ func checkCmdName(s string) error {
 	return nil
 }
 
-// checkCmdArgKey() checks whether a string is valid as an argument key.
+// checkCmdArgKey checks whether a string is valid as an argument key.
 func checkArgKey(s string) error {
 	if len(s) == 0 {
 		return fmt.Errorf("command name must not be empty")
@@ -301,7 +301,7 @@ type cmdArg struct {
 	Value string
 }
 
-// composeCommand() composes a command from a name and arguments.
+// composeCommand composes a command from its name and arguments.
 func (db *DB) composeCommand(name string, args []cmdArg) (string, error) {
 	if err := checkCmdName(name); err != nil {
 		return "", err
@@ -334,7 +334,7 @@ func (db *DB) send(data []byte) error {
 	return nil
 }
 
-// recv() receives the result of a command sent by send().
+// recv receives the response to sent data.
 func (db *DB) recv() ([]byte, error) {
 	var res *C.char
 	var resLen C.uint
@@ -366,7 +366,7 @@ func (db *DB) recv() ([]byte, error) {
 	return buf.Bytes(), nil
 }
 
-// query() executes a command.
+// query sends data and receives the response.
 func (db *DB) query(cmd string) ([]byte, error) {
 	if err := db.send([]byte(cmd)); err != nil {
 		res, _ := db.recv()
@@ -375,7 +375,7 @@ func (db *DB) query(cmd string) ([]byte, error) {
 	return db.recv()
 }
 
-// qureyEx() executes a command with separated arguments.
+// query sends a command and receives the response.
 func (db *DB) queryEx(name string, args []cmdArg) ([]byte, error) {
 	cmd, err := db.composeCommand(name, args)
 	if err != nil {

  Modified: grnci.go (+61 -61)
===================================================================
--- grnci.go    2016-02-18 17:29:11 +0900 (72f2a6d)
+++ grnci.go    2016-02-18 17:42:01 +0900 (58770c6)
@@ -25,7 +25,7 @@ import (
 // Error handling
 //
 
-// String() returns an error code with its name as a string.
+// String returns an error code with its name as a string.
 func (rc C.grn_rc) String() string {
 	switch rc {
 	case C.GRN_SUCCESS:
@@ -193,7 +193,7 @@ func (rc C.grn_rc) String() string {
 // Utility
 //
 
-// checkTableName() checks whether a string is valid as a table name.
+// checkTableName checks whether a string is valid as a table name.
 func checkTableName(s string) error {
 	if len(s) == 0 {
 		return fmt.Errorf("table name must not be empty")
@@ -212,7 +212,7 @@ func checkTableName(s string) error {
 	return nil
 }
 
-// checkColumnName() checks whether a string is valid as a column name.
+// checkColumnName checks whether a string is valid as a column name.
 func checkColumnName(s string) error {
 	if len(s) == 0 {
 		return fmt.Errorf("column name must not be empty")
@@ -228,9 +228,9 @@ func checkColumnName(s string) error {
 	return nil
 }
 
-// splitValues() splits a string separated by sep into values.
+// splitValues splits a string separated by sep into values.
 //
-// If s contains only white spaces, splitValues() returns an empty slice.
+// If s contains only white spaces, splitValues returns an empty slice.
 func splitValues(s string, sep byte) []string {
 	var vals []string
 	for {
@@ -247,7 +247,7 @@ func splitValues(s string, sep byte) []string {
 	}
 }
 
-// parseColumnNames() parses comma-separated column names.
+// parseColumnNames parses comma-separated column names.
 func parseColumnNames(s string) ([]string, error) {
 	s = strings.TrimSpace(s)
 	if len(s) == 0 {
@@ -332,15 +332,15 @@ type TableCreateOptions struct {
 	TokenFilters     string // --token_filters
 }
 
-// NewTableCreateOptions() returns the default options.
+// NewTableCreateOptions returns the default options.
 func NewTableCreateOptions() *TableCreateOptions {
 	options := new(TableCreateOptions)
 	return options
 }
 
-// TableCreate() executes `table_create`.
+// TableCreate executes `table_create`.
 //
-// If options is nil, TableCreate() uses the default options.
+// If options is nil, TableCreate uses the default options.
 //
 // If options.Flags does not contain TABLE_NO_KEY and options.KeyType is empty,
 // TABLE_NO_KEY is automatically added to options.Flags.
@@ -430,12 +430,12 @@ func (db *DB) TableCreate(name string, options *TableCreateOptions) error {
 //
 // `column_create` takes --flags as a required argument but ColumnCreateOptions
 // has Flags because users can specify COLUMN_* via an argument typ of
-// ColumnCreate().
+// ColumnCreate.
 // This also means that COLUMN_* should not be set manually.
 //
 // `column_create` takes --source as an option but ColumnCreateOptions does not
 // have Source because users can specify --source via an argument typ of
-// ColumnCreate().
+// ColumnCreate.
 //
 // http://groonga.org/docs/reference/commands/column_create.html
 type ColumnCreateOptions struct {
@@ -448,7 +448,7 @@ func NewColumnCreateOptions() *ColumnCreateOptions {
 	return options
 }
 
-// ColumnCreate() executes `column_create`.
+// ColumnCreate executes `column_create`.
 //
 // If typ starts with "[]", COLUMN_VECTOR is added to --flags.
 // Else if typ contains ".", COLUMN_INDEX is added to --flags.
@@ -456,7 +456,7 @@ func NewColumnCreateOptions() *ColumnCreateOptions {
 // part (after '.') is used as --source.
 // Otherwise, COLUMN_SCALAR is added to --flags.
 //
-// If options is nil, ColumnCreate() uses the default options.
+// If options is nil, ColumnCreate uses the default options.
 //
 // http://groonga.org/docs/reference/commands/column_create.html
 func (db *DB) ColumnCreate(tbl, name, typ string, options *ColumnCreateOptions) error {
@@ -527,13 +527,13 @@ type LoadOptions struct {
 	IfExists string // --ifexists
 }
 
-// NewLoadOptions() returns the default options.
+// NewLoadOptions returns the default options.
 func NewLoadOptions() *LoadOptions {
 	options := new(LoadOptions)
 	return options
 }
 
-// loadWriteScalar() writes a scalar value.
+// loadWriteScalar writes a scalar value.
 func (db *DB) loadWriteScalar(buf *bytes.Buffer, any interface{}) error {
 	switch val := any.(type) {
 	case Bool:
@@ -590,7 +590,7 @@ func (db *DB) loadWriteScalar(buf *bytes.Buffer, any interface{}) error {
 	return nil
 }
 
-// loadWriteVector() writes a vector value.
+// loadWriteVector writes a vector value.
 func (db *DB) loadWriteVector(buf *bytes.Buffer, any interface{}) error {
 	if err := buf.WriteByte('['); err != nil {
 		return err
@@ -749,7 +749,7 @@ func (db *DB) loadWriteVector(buf *bytes.Buffer, any interface{}) error {
 	return nil
 }
 
-// loadWriteValue() writes a value.
+// loadWriteValue writes a value.
 func (db *DB) loadWriteValue(buf *bytes.Buffer, val *reflect.Value, fields []*FieldInfo) error {
 	if err := buf.WriteByte('['); err != nil {
 		return err
@@ -784,7 +784,7 @@ func (db *DB) loadWriteValue(buf *bytes.Buffer, val *reflect.Value, fields []*Fi
 	return nil
 }
 
-// loadGenBody() generates the `load` body.
+// loadGenBody generates the `load` body.
 func (db *DB) loadGenBody(tbl string, vals interface{}, fields []*FieldInfo) (string, error) {
 	buf := new(bytes.Buffer)
 	if err := buf.WriteByte('['); err != nil {
@@ -823,7 +823,7 @@ func (db *DB) loadGenBody(tbl string, vals interface{}, fields []*FieldInfo) (st
 	return buf.String(), nil
 }
 
-// Load() executes `load`.
+// Load executes `load`.
 //
 // vals accepts a struct, a pointer to struct and a slice of struct.
 // A struct and a pointer to struct are available to load one record.
@@ -838,11 +838,11 @@ func (db *DB) loadGenBody(tbl string, vals interface{}, fields []*FieldInfo) (st
 // The field name is used as the column name by default, but if the field has
 // a grnci tag, its value before the first ';' is used as the column name.
 //
-// Load() uses all the acceptable fields.
+// Load uses all the acceptable fields.
 // If you want to use a subset of the struct, specify --columns with
 // options.Columns.
 //
-// If options is nil, Load() uses the default options.
+// If options is nil, Load uses the default options.
 //
 // http://groonga.org/docs/reference/commands/load.html
 func (db *DB) Load(tbl string, vals interface{}, options *LoadOptions) (int, error) {
@@ -915,7 +915,7 @@ func (db *DB) Load(tbl string, vals interface{}, options *LoadOptions) (int, err
 // `table_create`, `column_create`, `load`
 //
 
-// loadExCreateTable() creates a table.
+// loadExCreateTable creates a table.
 func (db *DB) loadExCreateTable(tbl string, info *StructInfo) error {
 	options := NewTableCreateOptions()
 	for i := 0; i < info.NumField(); i++ {
@@ -986,7 +986,7 @@ func (db *DB) loadExCreateTable(tbl string, info *StructInfo) error {
 	return db.TableCreate(tbl, options)
 }
 
-// loadExCreateColumns() creates columns.
+// loadExCreateColumns creates columns.
 func (db *DB) loadExCreateColumns(tbl string, info *StructInfo) error {
 	for i := 0; i < info.NumField(); i++ {
 		// grnci:"name;type;flags"
@@ -1037,9 +1037,9 @@ func (db *DB) loadExCreateColumns(tbl string, info *StructInfo) error {
 	return nil
 }
 
-// LoadEx() executes `table_create`, `column_create` and `load`.
+// LoadEx executes `table_create`, `column_create` and `load`.
 //
-// LoadEx() calls TableCreate(), ColumnCreate() and Load().
+// LoadEx calls TableCreate, ColumnCreate and Load.
 // See each function for details.
 //
 // The grnci tag format is as follows:
@@ -1101,7 +1101,7 @@ type SelectOptions struct {
 	Adjuster                 string // --adjuster
 }
 
-// NewSelectOptions() returns the default options.
+// NewSelectOptions returns the default options.
 func NewSelectOptions() *SelectOptions {
 	return &SelectOptions{
 		Limit: 10,
@@ -1109,7 +1109,7 @@ func NewSelectOptions() *SelectOptions {
 	}
 }
 
-// selectParse() parses the result of `select`.
+// selectParse parses the result of `select`.
 func (db *DB) selectParse(data []byte, vals interface{}, fields []*FieldInfo) (int, error) {
 	var raw [][][]json.RawMessage
 	if err := json.Unmarshal(data, &raw); err != nil {
@@ -1181,18 +1181,18 @@ func (db *DB) selectParse(data []byte, vals interface{}, fields []*FieldInfo) (i
 	return nHits, nil
 }
 
-// Select() executes `select` (experimental).
+// Select executes `select` (experimental).
 //
-// Select() creates a new slice to store the result and then overwrites *vals
+// Select creates a new slice to store the result and then overwrites *vals
 // with the new slice.
 //
 // vals accepts a pointer to a slice of struct.
-// See Load() for details about how struct fields are handled.
+// See Load for details about how struct fields are handled.
 //
 // If you want to use a subset of the struct, specify --output_columns with
 // options.OutputColumns.
 //
-// If options is nil, Select() uses the default options.
+// If options is nil, Select uses the default options.
 //
 // http://groonga.org/docs/reference/commands/select.html
 func (db *DB) Select(tbl string, vals interface{}, options *SelectOptions) (int, error) {
@@ -1292,14 +1292,14 @@ func (db *DB) Select(tbl string, vals interface{}, options *SelectOptions) (int,
 type ColumnRemoveOptions struct {
 }
 
-// NewColumnRemoveOptions() returns the default options.
+// NewColumnRemoveOptions returns the default options.
 func NewColumnRemoveOptions() *ColumnRemoveOptions {
 	return &ColumnRemoveOptions{}
 }
 
-// ColumnRemove() executes `column_remove`.
+// ColumnRemove executes `column_remove`.
 //
-// If options is nil, ColumnRemove() uses the default options.
+// If options is nil, ColumnRemove uses the default options.
 //
 // http://groonga.org/docs/reference/commands/column_remove.html
 func (db *DB) ColumnRemove(tbl, name string, options *ColumnRemoveOptions) error {
@@ -1338,14 +1338,14 @@ func (db *DB) ColumnRemove(tbl, name string, options *ColumnRemoveOptions) error
 type ColumnRenameOptions struct {
 }
 
-// NewColumnRenameOptions() returns the default options.
+// NewColumnRenameOptions returns the default options.
 func NewColumnRenameOptions() *ColumnRenameOptions {
 	return &ColumnRenameOptions{}
 }
 
-// ColumnRename() executes `column_rename`.
+// ColumnRename executes `column_rename`.
 //
-// If options is nil, ColumnRename() uses the default options.
+// If options is nil, ColumnRename uses the default options.
 //
 // http://groonga.org/docs/reference/commands/column_rename.html
 func (db *DB) ColumnRename(tbl, name, newName string, options *ColumnRenameOptions) error {
@@ -1388,14 +1388,14 @@ func (db *DB) ColumnRename(tbl, name, newName string, options *ColumnRenameOptio
 type TableRemoveOptions struct {
 }
 
-// NewTableRemoveOptions() returns the default options.
+// NewTableRemoveOptions returns the default options.
 func NewTableRemoveOptions() *TableRemoveOptions {
 	return &TableRemoveOptions{}
 }
 
-// TableRemove() executes `table_remove`.
+// TableRemove executes `table_remove`.
 //
-// If options is nil, TableRemove() uses the default options.
+// If options is nil, TableRemove uses the default options.
 //
 // http://groonga.org/docs/reference/commands/table_remove.html
 func (db *DB) TableRemove(name string, options *TableRemoveOptions) error {
@@ -1430,14 +1430,14 @@ func (db *DB) TableRemove(name string, options *TableRemoveOptions) error {
 type TableRenameOptions struct {
 }
 
-// NewTableRenameOptions() returns the default options.
+// NewTableRenameOptions returns the default options.
 func NewTableRenameOptions() *TableRenameOptions {
 	return &TableRenameOptions{}
 }
 
-// TableRename() executes `table_rename`.
+// TableRename executes `table_rename`.
 //
-// If options is nil, TableRename() uses the default options.
+// If options is nil, TableRename uses the default options.
 //
 // http://groonga.org/docs/reference/commands/table_rename.html
 func (db *DB) TableRename(name, newName string, options *TableRenameOptions) error {
@@ -1476,14 +1476,14 @@ func (db *DB) TableRename(name, newName string, options *TableRenameOptions) err
 type ObjectExistOptions struct {
 }
 
-// NewObjectExistOptions() returns the default options.
+// NewObjectExistOptions returns the default options.
 func NewObjectExistOptions() *ObjectExistOptions {
 	return &ObjectExistOptions{}
 }
 
-// ObjectExist() executes `object_exist`.
+// ObjectExist executes `object_exist`.
 //
-// If options is nil, ObjectExist() uses the default options.
+// If options is nil, ObjectExist uses the default options.
 //
 // http://groonga.org/docs/reference/commands/object_exist.html
 func (db *DB) ObjectExist(name string, options *ObjectExistOptions) error {
@@ -1515,7 +1515,7 @@ func (db *DB) ObjectExist(name string, options *ObjectExistOptions) error {
 type TruncateOptions struct {
 }
 
-// NewTruncateOptions() returns the default options.
+// NewTruncateOptions returns the default options.
 func NewTruncateOptions() *TruncateOptions {
 	return &TruncateOptions{}
 }
@@ -1555,17 +1555,17 @@ type ThreadLimitOptions struct {
 	Max int // --max
 }
 
-// NewThreadLimitOptions() returns the default options.
+// NewThreadLimitOptions returns the default options.
 func NewThreadLimitOptions() *ThreadLimitOptions {
 	return &ThreadLimitOptions{}
 }
 
-// ThreadLimit() executes `thread_limit`.
+// ThreadLimit executes `thread_limit`.
 //
-// If options is nil, ThreadLimit() uses the default options.
+// If options is nil, ThreadLimit uses the default options.
 //
-// FIXME: Note that if db is a handle, ThreadLimit() returns 1 even though
-// DB.Dup() is used. This is a limitation of grnci.
+// FIXME: Note that if db is a handle, ThreadLimit returns 1 even though
+// DB.Dup is used. This is a limitation of grnci.
 //
 // http://groonga.org/docs/reference/commands/thread_limit.html
 func (db *DB) ThreadLimit(options *ThreadLimitOptions) (int, error) {
@@ -1603,14 +1603,14 @@ func (db *DB) ThreadLimit(options *ThreadLimitOptions) (int, error) {
 type DatabaseUnmapOptions struct {
 }
 
-// NewDatabaseUnmapOptions() returns the default options.
+// NewDatabaseUnmapOptions returns the default options.
 func NewDatabaseUnmapOptions() *DatabaseUnmapOptions {
 	return &DatabaseUnmapOptions{}
 }
 
-// DatabaseUnmap() executes `database_unmap`.
+// DatabaseUnmap executes `database_unmap`.
 //
-// If options is nil, DatabaseUnmap() uses the default options.
+// If options is nil, DatabaseUnmap uses the default options.
 //
 // http://groonga.org/docs/reference/commands/database_unmap.html
 func (db *DB) DatabaseUnmap(options *DatabaseUnmapOptions) error {
@@ -1641,14 +1641,14 @@ func (db *DB) DatabaseUnmap(options *DatabaseUnmapOptions) error {
 type PluginRegisterOptions struct {
 }
 
-// NewPluginRegisterOptions() returns the default options.
+// NewPluginRegisterOptions returns the default options.
 func NewPluginRegisterOptions() *PluginRegisterOptions {
 	return &PluginRegisterOptions{}
 }
 
-// PluginRegister() executes `plugin_register`.
+// PluginRegister executes `plugin_register`.
 //
-// If options is nil, PluginRegister() uses the default options.
+// If options is nil, PluginRegister uses the default options.
 //
 // http://groonga.org/docs/reference/commands/plugin_register.html
 func (db *DB) PluginRegister(name string, options *PluginRegisterOptions) error {
@@ -1680,14 +1680,14 @@ func (db *DB) PluginRegister(name string, options *PluginRegisterOptions) error
 type PluginUnregisterOptions struct {
 }
 
-// NewPluginUnregisterOptions() returns the default options.
+// NewPluginUnregisterOptions returns the default options.
 func NewPluginUnregisterOptions() *PluginUnregisterOptions {
 	return &PluginUnregisterOptions{}
 }
 
-// PluginUnregister() executes `plugin_unregister`.
+// PluginUnregister executes `plugin_unregister`.
 //
-// If options is nil, PluginUnregister() uses the default options.
+// If options is nil, PluginUnregister uses the default options.
 //
 // http://groonga.org/docs/reference/commands/plugin_unregister.html
 func (db *DB) PluginUnregister(name string, options *PluginUnregisterOptions) error {

  Modified: grnci_test.go (+22 -21)
===================================================================
--- grnci_test.go    2016-02-18 17:29:11 +0900 (b7664dc)
+++ grnci_test.go    2016-02-18 17:42:01 +0900 (8426b8d)
@@ -12,8 +12,8 @@ import (
 // Utility
 //
 
-// createTempDB() creates a database for tests.
-// The database must be removed with removeTempDB().
+// createTempDB creates a database for tests.
+// The database must be removed with removeTempDB.
 func createTempDB(tb testing.TB) (string, string, *DB) {
 	dirPath, err := ioutil.TempDir("", "grnci_test")
 	if err != nil {
@@ -28,7 +28,7 @@ func createTempDB(tb testing.TB) (string, string, *DB) {
 	return dirPath, dbPath, db
 }
 
-// removeTempDB() removes a database created with createTempDB().
+// removeTempDB removes a database created with createTempDB.
 func removeTempDB(tb testing.TB, dirPath string, db *DB) {
 	if err := db.Close(); err != nil {
 		os.RemoveAll(dirPath)
@@ -43,7 +43,7 @@ func removeTempDB(tb testing.TB, dirPath string, db *DB) {
 // Tests
 //
 
-// TestGrnInit() tests GrnInit() and GrnFin()
+// TestGrnInit tests GrnInit and GrnFin
 func TestGrnInit(t *testing.T) {
 	if err := GrnInit(); err != nil {
 		t.Fatalf("GrnInit failed: %v", err)
@@ -53,7 +53,7 @@ func TestGrnInit(t *testing.T) {
 	}
 }
 
-// TestCreate() tests Create().
+// TestCreate tests Create.
 func TestCreate(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -75,7 +75,7 @@ func TestCreate(t *testing.T) {
 	}
 }
 
-// TestCreate() tests Open().
+// TestCreate tests Open.
 func TestOpen(t *testing.T) {
 	dirPath, dbPath, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -103,7 +103,7 @@ func TestOpen(t *testing.T) {
 	}
 }
 
-// TestDup() tests DB.Dup().
+// TestDup tests DB.Dup.
 func TestDup(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -131,7 +131,7 @@ func TestDup(t *testing.T) {
 	}
 }
 
-// TestTableCreate() tests DB.TableCreate().
+// TestTableCreate tests DB.TableCreate.
 func TestTableCreate(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -166,7 +166,7 @@ func TestTableCreate(t *testing.T) {
 	}
 }
 
-// TestColumnCreate() tests DB.ColumnCreate().
+// TestColumnCreate tests DB.ColumnCreate.
 func TestColumnCreate(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -198,7 +198,7 @@ func TestColumnCreate(t *testing.T) {
 	}
 }
 
-// TestLoad() tests DB.Load().
+// TestLoad tests DB.Load.
 func TestLoad(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -295,7 +295,7 @@ func TestLoad(t *testing.T) {
 	}
 }
 
-// TestLoadEx() tests DB.LoadEx().
+// TestLoadEx tests DB.LoadEx.
 func TestLoadEx(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -348,7 +348,7 @@ func TestLoadEx(t *testing.T) {
 	}
 }
 
-// TestSelect() tests DB.Select().
+// TestSelect tests DB.Select.
 func TestSelect(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -406,7 +406,7 @@ func TestSelect(t *testing.T) {
 	}
 }
 
-// TestColumnRemove() tests DB.ColumnRemove().
+// TestColumnRemove tests DB.ColumnRemove.
 func TestColumnRemove(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -425,7 +425,7 @@ func TestColumnRemove(t *testing.T) {
 	}
 }
 
-// TestColumnRename() tests DB.ColumnRename().
+// TestColumnRename tests DB.ColumnRename.
 func TestColumnRename(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -447,7 +447,7 @@ func TestColumnRename(t *testing.T) {
 	}
 }
 
-// TestTableRemove() tests DB.TableRemove().
+// TestTableRemove tests DB.TableRemove.
 func TestTableRemove(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -463,7 +463,7 @@ func TestTableRemove(t *testing.T) {
 	}
 }
 
-// TestTableRename() tests DB.TableRename().
+// TestTableRename tests DB.TableRename.
 func TestTableRename(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -482,7 +482,7 @@ func TestTableRename(t *testing.T) {
 	}
 }
 
-// TestObjectExist() tests DB.ObjectExist().
+// TestObjectExist tests DB.ObjectExist.
 func TestObjectExist(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -508,7 +508,7 @@ func TestObjectExist(t *testing.T) {
 	}
 }
 
-// TestTruncate() tests DB.Truncate().
+// TestTruncate tests DB.Truncate.
 func TestTruncate(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -527,7 +527,7 @@ func TestTruncate(t *testing.T) {
 	}
 }
 
-// TestThreadLimit() tests DB.ThreadLimit().
+// TestThreadLimit tests DB.ThreadLimit.
 func TestThreadLimit(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -541,7 +541,7 @@ func TestThreadLimit(t *testing.T) {
 	}
 }
 
-// TestDatabaseUnmap() tests DB.DatabaseUnmap().
+// TestDatabaseUnmap tests DB.DatabaseUnmap.
 func TestDatabaseUnmap(t *testing.T) {
 	dirPath, _, db := createTempDB(t)
 	defer removeTempDB(t, dirPath, db)
@@ -551,7 +551,7 @@ func TestDatabaseUnmap(t *testing.T) {
 	}
 }
 
-// TestMarshalJSON() tests MarshalJSON().
+// TestMarshalJSON tests MarshalJSON.
 func TestMarshalJSON(t *testing.T) {
 	type tblRec struct {
 		Key    Text    `grnci:"_key;;TABLE_PAT_KEY"`
@@ -584,6 +584,7 @@ func TestMarshalJSON(t *testing.T) {
 	}
 }
 
+// TestGetStructInfo tests GetStructInfo
 func TestGetStructInfo(t *testing.T) {
 	info := GetStructInfo(nil)
 	if err := info.Error(); err == nil {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index