etcd: fix typos

This commit is contained in:
Oliver Gugger
2022-09-30 14:17:08 +02:00
parent b51b1e2f73
commit 98f359c5b7
4 changed files with 13 additions and 13 deletions

View File

@@ -92,7 +92,7 @@ func getKeyVal(kv *KV) ([]byte, []byte) {
return getKey(kv.key), val
}
// BucketKey is a helper functon used in tests to create a bucket key from
// BucketKey is a helper function used in tests to create a bucket key from
// passed bucket list.
func BucketKey(buckets ...string) string {
var bucketKey []byte

View File

@@ -22,7 +22,7 @@ const (
// the etcd instance.
etcdConnectionTimeout = 10 * time.Second
// etcdLongTimeout is a timeout for longer taking etcd operatons.
// etcdLongTimeout is a timeout for longer taking etcd operations.
etcdLongTimeout = 30 * time.Second
// etcdDefaultRootBucketId is used as the root bucket key. Note that
@@ -52,8 +52,8 @@ type commitStatsCollector struct {
fail map[string]*callerStats
}
// newCommitStatsColletor creates a new commitStatsCollector instance.
func newCommitStatsColletor() *commitStatsCollector {
// newCommitStatsCollector creates a new commitStatsCollector instance.
func newCommitStatsCollector() *commitStatsCollector {
return &commitStatsCollector{
succ: make(map[string]*callerStats),
fail: make(map[string]*callerStats),
@@ -181,7 +181,7 @@ func newEtcdBackend(ctx context.Context, cfg Config) (*db, error) {
}
if cfg.CollectStats {
backend.commitStatsCollector = newCommitStatsColletor()
backend.commitStatsCollector = newCommitStatsCollector()
}
return backend, nil

View File

@@ -41,8 +41,8 @@ func NewTestEtcdInstance(t *testing.T, path string) (*Config, func()) {
return config, cleanup
}
// NewTestEtcdTestFixture creates a new etcd-test fixture. This is helper
// object to facilitate etcd tests and ensure pre and post conditions.
// NewEtcdTestFixture creates a new etcd-test fixture. This is helper
// object to facilitate etcd tests and ensure pre- and post-conditions.
func NewEtcdTestFixture(t *testing.T) *EtcdTestFixture {
tmpDir := t.TempDir()
@@ -128,7 +128,7 @@ func (f *EtcdTestFixture) Dump() map[string]string {
return result
}
// BackendConfig returns the backend config for connecting to theembedded
// BackendConfig returns the backend config for connecting to the embedded
// etcd instance.
func (f *EtcdTestFixture) BackendConfig() Config {
return *f.config

View File

@@ -318,7 +318,7 @@ func (b *readWriteBucket) DeleteNestedBucket(key []byte) error {
}
// Put updates the value for the passed key.
// Returns ErrKeyRequred if te passed key is empty.
// Returns ErrKeyRequired if the passed key is empty.
func (b *readWriteBucket) Put(key, value []byte) error {
if len(key) == 0 {
return walletdb.ErrKeyRequired
@@ -335,7 +335,7 @@ func (b *readWriteBucket) Put(key, value []byte) error {
}
// Delete deletes the key/value pointed to by the passed key.
// Returns ErrKeyRequred if the passed key is empty.
// Returns ErrKeyRequired if the passed key is empty.
func (b *readWriteBucket) Delete(key []byte) error {
if key == nil {
return nil
@@ -360,7 +360,7 @@ func (b *readWriteBucket) Tx() walletdb.ReadWriteTx {
return b.tx
}
// NextSequence returns an autoincrementing sequence number for this bucket.
// NextSequence returns an auto-incrementing sequence number for this bucket.
// Note that this is not a thread safe function and as such it must not be used
// for synchronization.
func (b *readWriteBucket) NextSequence() (uint64, error) {
@@ -396,7 +396,7 @@ func (b *readWriteBucket) Sequence() uint64 {
return 0
}
// Otherwise try to parse a 64 bit unsigned integer from the value.
// Otherwise try to parse a 64-bit unsigned integer from the value.
num, _ := strconv.ParseUint(string(val), 10, 64)
return num
@@ -414,7 +414,7 @@ func flattenMap(m map[string]struct{}) []string {
return result
}
// Prefetch will prefetch all keys in the passed paths as well as all bucket
// Prefetch will prefetch all keys in the passed-in paths as well as all bucket
// keys along the paths.
func (b *readWriteBucket) Prefetch(paths ...[]string) {
keys := make(map[string]struct{})