Skip to content
Browse files

remove unconventional parens after function names in godoc

  • Loading branch information...
1 parent 28e944a commit 76aa28ad52c16cb4105ce1cf66907689f00f801b @jmhodges committed Mar 31, 2012
Showing with 47 additions and 47 deletions.
  1. +2 −2 batch.go
  2. +3 −3 cache.go
  3. +6 −6 db.go
  4. +1 −1 doc.go
  5. +1 −1 env.go
  6. +24 −24 iterator.go
  7. +10 −10 options.go
View
4 batch.go
@@ -9,9 +9,9 @@ import (
)
// WriteBatch is a batching of Puts, and Deletes to be written atomically to a
-// database. A WriteBatch is written when passed to DB.Write().
+// database. A WriteBatch is written when passed to DB.Write.
//
-// To prevent memory leaks, call Close() when the program no longer needs the
+// To prevent memory leaks, call Close when the program no longer needs the
// WriteBatch object.
type WriteBatch struct {
wbatch *C.leveldb_writebatch_t
View
6 cache.go
@@ -7,10 +7,10 @@ import "C"
// Cache is a cache used to store data read from data in memory.
//
-// Typically, NewLRUCache() is all you will need, but advanced users may
+// Typically, NewLRUCache is all you will need, but advanced users may
// implement their own *C.leveldb_cache_t and create a Cache.
//
-// To prevent memory leaks, a Cache must have Close() called on it when it is
+// To prevent memory leaks, a Cache must have Close called on it when it is
// no longer needed by the program. Note: if the process is shutting down,
// this may not be necessary and could be avoided to shorten shutdown time.
type Cache struct {
@@ -19,7 +19,7 @@ type Cache struct {
// NewLRUCache creates a new Cache object with the capacity given.
//
-// To prevent memory leaks, Close() should be called on the Cache when the
+// To prevent memory leaks, Close should be called on the Cache when the
// program no longer needs it. Note: if the process is shutting down, this may
// not be necessary and could be avoided to shorten shutdown time.
func NewLRUCache(capacity int) *Cache {
View
12 db.go
@@ -17,11 +17,11 @@ func (e DatabaseError) Error() string {
// DB is a reusable handle to a LevelDB database on disk, created by Open.
//
-// To avoid memory and file descriptor leaks, call Close() when you are
+// To avoid memory and file descriptor leaks, call Close when you are
// through with the handle.
//
-// All methods on a DB instance are thread-safe except for Close(). Calls to
-// any DB method made after Close() will panic.
+// All methods on a DB instance are thread-safe except for Close. Calls to
+// any DB method made after Close will panic.
type DB struct {
Ldb *C.leveldb_t
}
@@ -38,7 +38,7 @@ type Range struct {
// Creating a new database is done by calling SetCreateIfMissing(true) on the
// Options passed to Open.
//
-// It is usually wise to set a Cache object on the Options with SetCache() to
+// It is usually wise to set a Cache object on the Options with SetCache to
// keep recently used data from that database in memory.
func Open(dbname string, o *Options) (*DB, error) {
var errStr *C.char
@@ -180,7 +180,7 @@ func (db *DB) Write(wo *WriteOptions, w *WriteBatch) error {
// data. This can be done by calling SetFillCache(false) on the ReadOptions
// before passing it here.
//
-// Similiarly, ReadOptions.SetSnapshot() is also useful.
+// Similiarly, ReadOptions.SetSnapshot is also useful.
func (db *DB) NewIterator(ro *ReadOptions) *Iterator {
it := C.leveldb_create_iterator(db.Ldb, ro.Opt)
return &Iterator{Iter: it}
@@ -233,7 +233,7 @@ func (db *DB) PropertyValue(propName string) string {
// state of the database at the the snapshot was created.
//
// To prevent memory leaks and resource strain in the database, the snapshot
-// returned must be released with this DB's ReleaseSnapshot() method.
+// returned must be released with this DB's ReleaseSnapshot method.
//
// See the LevelDB C++ documentation docs for details.
func (db *DB) NewSnapshot() *C.leveldb_snapshot_t {
View
2 doc.go
@@ -40,7 +40,7 @@ Batched, atomic writes can be performed with a WriteBatch and
DB.Write().
wb := levigo.NewWriteBatch()
- // defer wb.Close() or use wb.Clear() and reuse.
+ // defer wb.Close or use wb.Clear and reuse.
wb.Delete([]byte("removed"))
wb.Put([]byte("added"), []byte("data"))
wb.Put([]byte("anotheradded"), []byte("more"))
View
2 env.go
@@ -9,7 +9,7 @@ import "C"
// Typically, NewDefaultEnv is all you need. Advanced users may create their
// own Env with a *C.leveldb_env_t of their own creation.
//
-// To prevent memory leaks, an Env must have Close() called on it when it is
+// To prevent memory leaks, an Env must have Close called on it when it is
// no longer needed by the program.
type Env struct {
Env *C.leveldb_env_t
View
48 iterator.go
@@ -18,14 +18,14 @@ func (e IteratorError) Error() string {
// way to seek to specific keys and iterate through the keyspace from
// that point, as well as access the values of those keys.
//
-// Care must be taken when using an Iterator. If the method Valid() returns
-// false, calls to Key(), Value(), Next(), and Prev() will result in
-// panics. However, Seek(), SeekToFirst(), SeekToLast(), GetError(), Valid()
-// and Close() will still be safe to call.
+// Care must be taken when using an Iterator. If the method Valid returns
+// false, calls to Key, Value, Next, and Prev will result in
+// panics. However, Seek, SeekToFirst, SeekToLast, GetError, Valid
+// and Close will still be safe to call.
//
-// GetError() will only return an error in the event of a LevelDB error. It
+// GetError will only return an error in the event of a LevelDB error. It
// will return a nil on iterators that are simply invalid. Given that
-// behavior, GetError() is not a replacement for a Valid().
+// behavior, GetError is not a replacement for a Valid.
//
// A typical use looks like:
//
@@ -38,82 +38,82 @@ func (e IteratorError) Error() string {
// useKeyAndValue(it.Key(), it.Value())
// }
//
-// To prevent memory leaks, an Iterator must have Close() called on it when
+// To prevent memory leaks, an Iterator must have Close called on it when
// it is no longer needed by the program.
type Iterator struct {
Iter *C.leveldb_iterator_t
}
-// Valid() returns false only when an Iterator has iterated past either the
+// Valid returns false only when an Iterator has iterated past either the
// first or the last key in the database.
func (it *Iterator) Valid() bool {
return ucharToBool(C.leveldb_iter_valid(it.Iter))
}
-// Key() returns a copy the key in the database the iterator currently holds.
+// Key returns a copy the key in the database the iterator currently holds.
//
-// If Valid() returns false, this method will panic.
+// If Valid returns false, this method will panic.
func (it *Iterator) Key() []byte {
var klen C.size_t
kdata := C.leveldb_iter_key(it.Iter, &klen)
return C.GoBytes(unsafe.Pointer(kdata), C.int(klen))
}
-// Value() returns a copy of the value in the database the iterator currently
+// Value returns a copy of the value in the database the iterator currently
// holds.
//
-// If Valid() returns false, this method will panic.
+// If Valid returns false, this method will panic.
func (it *Iterator) Value() []byte {
var vlen C.size_t
vdata := C.leveldb_iter_value(it.Iter, &vlen)
return C.GoBytes(unsafe.Pointer(vdata), C.int(vlen))
}
-// Next() moves the iterator to the next sequential key in the database, as
+// Next moves the iterator to the next sequential key in the database, as
// defined by the Comparator in the ReadOptions.
//
-// If Valid() returns false, this method will panic.
+// If Valid returns false, this method will panic.
func (it *Iterator) Next() {
C.leveldb_iter_next(it.Iter)
}
-// Prev() moves the iterator to the previous sequential key in the database,
+// Prev moves the iterator to the previous sequential key in the database,
// as defined by the Comparator in the ReadOptions used to create this
// Iterator.
//
-// If Valid() returns false, this method will panic.
+// If Valid returns false, this method will panic.
func (it *Iterator) Prev() {
C.leveldb_iter_prev(it.Iter)
}
-// SeekToFirst() moves the iterator to the first key in the database, as
+// SeekToFirst moves the iterator to the first key in the database, as
// defined by the Comparator in the ReadOptions used to create this Iterator.
//
-// This method is safe to call when Valid() returns false.
+// This method is safe to call when Valid returns false.
func (it *Iterator) SeekToFirst() {
C.leveldb_iter_seek_to_first(it.Iter)
}
-// SeekToLast() moves the iterator to the last key in the database, as
+// SeekToLast moves the iterator to the last key in the database, as
// defined by the Comparator in the ReadOptions used to create this Iterator.
//
-// This method is safe to call when Valid() returns false.
+// This method is safe to call when Valid returns false.
func (it *Iterator) SeekToLast() {
C.leveldb_iter_seek_to_last(it.Iter)
}
-// Seek() moves the iterator the position of the key given or, if the key
+// Seek moves the iterator the position of the key given or, if the key
// doesn't exist, the next key that does exist in the database. If the key
// doesn't exist, and there is no next key, the Iterator becomes invalid.
//
-// This method is safe to call when Valid() returns false.
+// This method is safe to call when Valid returns false.
func (it *Iterator) Seek(key []byte) {
C.leveldb_iter_seek(it.Iter, (*C.char)(unsafe.Pointer(&key[0])), C.size_t(len(key)))
}
-// GetError() returns an error from LevelDB found while iterating.
+// GetError returns an error from LevelDB found while iterating.
//
-// This method is safe to call when Valid() returns false.
+// This method is safe to call when Valid returns false.
func (it *Iterator) GetError() error {
var errStr *C.char
C.leveldb_iter_get_error(it.Iter, &errStr)
View
20 options.go
@@ -14,12 +14,12 @@ const (
)
// Options represent all of the available options when opening a database with
-// Open(). Options should be created with NewOptions().
+// Open. Options should be created with NewOptions.
//
-// It is usually with to call SetCache() with a cache object. Otherwise, all
+// It is usually with to call SetCache with a cache object. Otherwise, all
// data will be read off disk.
//
-// To prevent memory leaks, DestroyOptions() must be called on an Options when
+// To prevent memory leaks, DestroyOptions must be called on an Options when
// the program no longer needs it.
//
type Options struct {
@@ -29,7 +29,7 @@ type Options struct {
// ReadOptions represent all of the available options when reading from a
// database.
//
-// To prevent memory leaks, DestroyReadOptions() must called on a ReadOptions
+// To prevent memory leaks, DestroyReadOptions must called on a ReadOptions
// when the program no longer needs it
type ReadOptions struct {
Opt *C.leveldb_readoptions_t
@@ -38,15 +38,15 @@ type ReadOptions struct {
// WriteOptions represent all of the available options when writeing from a
// database.
//
-// To prevent memory leaks, DestroyWriteOptions() must called on a
+// To prevent memory leaks, DestroyWriteOptions must called on a
// WriteOptions when the program no longer needs it
type WriteOptions struct {
Opt *C.leveldb_writeoptions_t
}
// NewOptions allocates a new Options object.
//
-// To prevent memory leaks, the Options returned must have DestroyOptions()
+// To prevent memory leaks, the Options returned must have DestroyOptions
// called on it when it is no longer needed by the program.
func NewOptions() *Options {
opt := C.leveldb_options_create()
@@ -55,7 +55,7 @@ func NewOptions() *Options {
// NewReadOptions allocates a new ReadOptions object.
//
-// To prevent memory leaks, the ReadOptions returned must have Close() called
+// To prevent memory leaks, the ReadOptions returned must have Close called
// on it when it is no longer needed by the program.
func NewReadOptions() *ReadOptions {
opt := C.leveldb_readoptions_create()
@@ -64,7 +64,7 @@ func NewReadOptions() *ReadOptions {
// NewWriteOptions allocates a new WriteOptions object.
//
-// To prevent memory leaks, the WriteOptions returned must have Close()
+// To prevent memory leaks, the WriteOptions returned must have Close
// called on it when it is no longer needed by the program.
func NewWriteOptions() *WriteOptions {
opt := C.leveldb_writeoptions_create()
@@ -188,14 +188,14 @@ func (ro *ReadOptions) SetVerifyChecksums(b bool) {
// underlying storage to be placed in the database cache, if the cache exists.
//
// It is useful to turn this off on ReadOptions that are used for
-// DB.Iterator(), as it will prevent bulk scans from flushing out live user
+// DB.Iterator, as it will prevent bulk scans from flushing out live user
// data in the cache.
func (ro *ReadOptions) SetFillCache(b bool) {
C.leveldb_readoptions_set_fill_cache(ro.Opt, boolToUchar(b))
}
// SetSnapshot causes reads to provided as they were when the passed in
-// Snapshot was created by DB.NewSnapshot().
+// Snapshot was created by DB.NewSnapshot.
//
// See the LevelDB C++ documentation for details.
func (ro *ReadOptions) SetSnapshot(snap *C.leveldb_snapshot_t) {

0 comments on commit 76aa28a

Please sign in to comment.
Something went wrong with that request. Please try again.