From 7e8d5ff6b389a3624d62310f3ce7973e643fcc78 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Fri, 19 Jul 2024 22:58:51 +0200 Subject: [PATCH] Fix typos --- README.md | 2 +- cmd/kivik/log/log.go | 2 +- couchdb/chttp/chttp.go | 2 +- couchdb/db_test.go | 2 +- couchdb/iter.go | 2 +- couchdb/iter_test.go | 4 ++-- couchdb/replication_test.go | 2 +- couchdb/util_test.go | 2 +- db_test.go | 2 +- doc.go | 2 +- driver/driver.go | 4 ++-- driver/search.go | 4 ++-- int/errors/errors.go | 2 +- kiviktest/client/replicate.go | 2 +- pouchdb/bindings/pouchdb.go | 2 +- pouchdb/find.go | 2 +- pouchdb/find_test.go | 2 +- pouchdb/pouchdb.go | 2 +- x/fsdb/doc.go | 2 +- x/fsdb/filesystem/fs.go | 2 +- x/fsdb/put.go | 2 +- x/fsdb/testdata/TestGet_non-standard_filenames | 2 +- "x/fsdb/testdata/db_nonascii/note-i_\311\252.yaml" | 2 +- x/sqlite/json.go | 2 +- x/sqlite/query_test.go | 4 ++-- x/sqlite/views_test.go | 4 ++-- 26 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 2a25ab37f..fbb1f4054 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ This is a partial list of breaking changes between 3.x and 4.x - Options are no longer a simple `map[string]interface{}`, but are rather functional parameters. In most cases, you can just use `kivik.Param(key, value)`, or `kivik.Params(map[string]interface{}{key: value})` as a replacement. Some shortcuts for common params now exist, and driver-specific options may work differently. Consult the GoDoc. - The `Authenticate` method has been removed. Authentication is now handled via option parameters. -- The CouchDB, PouchDB, and MockDB drivers, and the experimental FilesystemDB and MemoryDB drivers, have been merged with this repo, rather than behing hosted in separate repos. For v3 you would have imported `github.com/go-kivik/couchdb/v3`, for example. With v4, you instead use `github.com/go-kivik/kivik/v4/couchdb` for CouchDB, or `github.com/go-kivik/kivik/v4/x/fsdb` for the experimental FilesystemDB driver. +- The CouchDB, PouchDB, and MockDB drivers, and the experimental FilesystemDB and MemoryDB drivers, have been merged with this repo, rather than being hosted in separate repos. For v3 you would have imported `github.com/go-kivik/couchdb/v3`, for example. With v4, you instead use `github.com/go-kivik/kivik/v4/couchdb` for CouchDB, or `github.com/go-kivik/kivik/v4/x/fsdb` for the experimental FilesystemDB driver. - The return type for queries has been significantly changed. - In 3.x, queries returned a `*Rows` struct. Now they return a `*ResultSet`. - The `Offset()`, `TotalRows()`, `UpdateSeq()`, `Warning()` and `Bookmark()` methods have been removed, and replaced with the `ResultMetadata` type which is accessed via the `Metadata()` method. See [issue #552](https://github.com/go-kivik/kivik/issues/552). diff --git a/cmd/kivik/log/log.go b/cmd/kivik/log/log.go index cb617bf45..fd5a27d6d 100644 --- a/cmd/kivik/log/log.go +++ b/cmd/kivik/log/log.go @@ -34,7 +34,7 @@ type Logger interface { Debugf(string, ...interface{}) // Info logs normal priority messages. Info(...interface{}) - // Infof logs formatted normal priorty messages. + // Infof logs formatted normal priority messages. Infof(string, ...interface{}) // Error logs error messages. Error(...interface{}) diff --git a/couchdb/chttp/chttp.go b/couchdb/chttp/chttp.go index d9bc49cb4..e6c00a7ae 100644 --- a/couchdb/chttp/chttp.go +++ b/couchdb/chttp/chttp.go @@ -285,7 +285,7 @@ func netError(err error) error { return nil } if urlErr, ok := err.(*url.Error); ok { - // If this error was generated by EncodeBody, it may have an emedded + // If this error was generated by EncodeBody, it may have an embedded // status code (!= 500), which we should honor. status := kivik.HTTPStatus(urlErr.Err) if status == http.StatusInternalServerError { diff --git a/couchdb/db_test.go b/couchdb/db_test.go index 02f5bbb5c..4c9971c40 100644 --- a/couchdb/db_test.go +++ b/couchdb/db_test.go @@ -1758,7 +1758,7 @@ func TestRowsQuery(t *testing.T) { if warner, ok := rows.(driver.RowsWarner); ok { result.Warning = warner.Warning() } else { - t.Errorf("RowsWarner interface not satisified!!?") + t.Errorf("RowsWarner interface not satisfied!!?") } if d := queryResultDiff(test.expected, result); d != "" { diff --git a/couchdb/iter.go b/couchdb/iter.go index f4f781aaa..91cff3829 100644 --- a/couchdb/iter.go +++ b/couchdb/iter.go @@ -299,7 +299,7 @@ func consumeDelim(dec *json.Decoder, expectedDelim json.Delim) error { } // unexpectedDelim is used to indicate to the multiQueriesRows type that the -// end of input has been reached, while behaving as an unexpected delimter +// end of input has been reached, while behaving as an unexpected delimiter // error to all other code. type unexpectedDelim byte diff --git a/couchdb/iter_test.go b/couchdb/iter_test.go index 4ac128634..02db04ed2 100644 --- a/couchdb/iter_test.go +++ b/couchdb/iter_test.go @@ -24,7 +24,7 @@ import ( ) func TestCancelableReadCloser(t *testing.T) { - t.Run("no cancelation", func(t *testing.T) { + t.Run("no cancellation", func(t *testing.T) { t.Parallel() rc := newCancelableReadCloser( context.Background(), @@ -38,7 +38,7 @@ func TestCancelableReadCloser(t *testing.T) { t.Errorf("Unexpected result: %s", string(result)) } }) - t.Run("pre-canceled", func(t *testing.T) { + t.Run("pre-cancelled", func(t *testing.T) { t.Parallel() ctx, cancel := context.WithCancel(context.Background()) cancel() diff --git a/couchdb/replication_test.go b/couchdb/replication_test.go index 75e6dbccc..15a82e393 100644 --- a/couchdb/replication_test.go +++ b/couchdb/replication_test.go @@ -169,7 +169,7 @@ func TestReplicate(t *testing.T) { { name: "invalid options", client: func() *client { - client := newTestClient(nil, errors.New("net eror")) + client := newTestClient(nil, errors.New("net error")) b := false client.schedulerDetected = &b return client diff --git a/couchdb/util_test.go b/couchdb/util_test.go index 9a3f72d18..ca9ace69f 100644 --- a/couchdb/util_test.go +++ b/couchdb/util_test.go @@ -51,7 +51,7 @@ func TestDeJSONify(t *testing.T) { expected: map[string]string{"foo": "bar"}, }, { - name: "invalid JSON sring", + name: "invalid JSON string", input: `{"foo":"\C"}`, status: http.StatusBadRequest, err: "invalid character 'C' in string escape code", diff --git a/db_test.go b/db_test.go index 9a5349b95..f74a2daa9 100644 --- a/db_test.go +++ b/db_test.go @@ -2625,7 +2625,7 @@ func TestGetAttachmentMeta(t *testing.T) { // nolint: gocyclo err: "kivik: client closed", }, { - name: "db eror", + name: "db error", db: &DB{ err: errors.New("db error"), }, diff --git a/doc.go b/doc.go index 25622853c..96dcf172c 100644 --- a/doc.go +++ b/doc.go @@ -44,7 +44,7 @@ documentation for the standard library's [encoding/json] package. # Options Most client and database methods take optional arguments of the type [Option]. -Multiple options may be passed, and latter options take precidence over earlier +Multiple options may be passed, and latter options take precedence over earlier ones, in case of a conflict. [Params] and [Param] can be used to set options that are generally converted to diff --git a/driver/driver.go b/driver/driver.go index 3ee13ce70..3cebed7fb 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -83,7 +83,7 @@ type DBsStatser interface { // _all_dbs + the [DBStatser] interface (or its respective emulation). type AllDBsStatser interface { // AllDBsStats returns database statistical information for each database - // in the CouchDB instance. See the [CouchDB documenatation] for supported + // in the CouchDB instance. See the [CouchDB documentation] for supported // options. // // [CouchDB documentation]: https://docs.couchdb.org/en/stable/api/server/common.html#get--_dbs_info @@ -272,7 +272,7 @@ type Document struct { // Attachments is an iterator over the attachments included in a document when // [DB.Get] is called with `attachments=true`. type Attachments interface { - // Next is called to pupulate att with the next attachment in the result + // Next is called to populate att with the next attachment in the result // set. // // Next should return [io.EOF] when there are no more attachments. diff --git a/driver/search.go b/driver/search.go index 9c433084d..72c5c7ee0 100644 --- a/driver/search.go +++ b/driver/search.go @@ -25,7 +25,7 @@ type SearchInfo struct { RawResponse json.RawMessage } -// SearchIndex contains textual search index informatoin. +// SearchIndex contains textual search index information. type SearchIndex struct { PendingSeq int64 DocDelCount int64 @@ -42,6 +42,6 @@ type Searcher interface { Search(ctx context.Context, ddoc, index, query string, options map[string]interface{}) (Rows, error) // SearchInfo returns statistics about the specified search index. SearchInfo(ctx context.Context, ddoc, index string) (*SearchInfo, error) - // SerachAnalyze tests the results of Lucene analyzer tokenization on sample text. + // SearchAnalyze tests the results of Lucene analyzer tokenization on sample text. SearchAnalyze(ctx context.Context, text string) ([]string, error) } diff --git a/int/errors/errors.go b/int/errors/errors.go index 80a811615..24d137baa 100644 --- a/int/errors/errors.go +++ b/int/errors/errors.go @@ -39,7 +39,7 @@ func (c CompositeError) HTTPStatus() int { // Error represents an error returned by Kivik. // // This type definition is not guaranteed to remain stable, or even exported. -// When examining errors programatically, you should rely instead on the +// When examining errors programmatically, you should rely instead on the // HTTPStatus() function in this package, rather than on directly observing // the fields of this type. type Error struct { diff --git a/kiviktest/client/replicate.go b/kiviktest/client/replicate.go index f6641f571..4de2c461d 100644 --- a/kiviktest/client/replicate.go +++ b/kiviktest/client/replicate.go @@ -98,7 +98,7 @@ func testReplication(ctx *kt.Context, client *kivik.Client) { } } if !success { - ctx.Errorf("Replication failied after %d tries", tries) + ctx.Errorf("Replication failed after %d tries", tries) } }) ctx.Run("MissingSource", func(ctx *kt.Context) { diff --git a/pouchdb/bindings/pouchdb.go b/pouchdb/bindings/pouchdb.go index efa8b5574..2c55a6d98 100644 --- a/pouchdb/bindings/pouchdb.go +++ b/pouchdb/bindings/pouchdb.go @@ -183,7 +183,7 @@ func (p *PouchDB) AllDBs(ctx context.Context) ([]string, error) { return allDBs, nil } -// DBInfo is a struct respresenting information about a specific database. +// DBInfo is a struct representing information about a specific database. type DBInfo struct { *js.Object Name string `js:"db_name"` diff --git a/pouchdb/find.go b/pouchdb/find.go index cab9253b6..32067976f 100644 --- a/pouchdb/find.go +++ b/pouchdb/find.go @@ -31,7 +31,7 @@ import ( var _ driver.Finder = &db{} -// buildIndex merges the ddoc and name into the index structure, as reqiured +// buildIndex merges the ddoc and name into the index structure, as required // by the PouchDB-find plugin. func buildIndex(ddoc, name string, index interface{}) (*js.Object, error) { i, err := bindings.Objectify(index) diff --git a/pouchdb/find_test.go b/pouchdb/find_test.go index 9bf9d5448..22d33accb 100644 --- a/pouchdb/find_test.go +++ b/pouchdb/find_test.go @@ -80,7 +80,7 @@ func TestExplain(t *testing.T) { tests.Add("query error", test{ db: &db{db: bindings.GlobalPouchDB().New("foo", nil)}, query: nil, - err: "TypeError: Cannot read propert", + err: "TypeError: Cannot read properties", }) tests.Add("simple selector", func(t *testing.T) interface{} { options := map[string]interface{}{ diff --git a/pouchdb/pouchdb.go b/pouchdb/pouchdb.go index 48a98de55..03c38fdf7 100644 --- a/pouchdb/pouchdb.go +++ b/pouchdb/pouchdb.go @@ -81,7 +81,7 @@ type client struct { opts map[string]Options pouch *bindings.PouchDB - // This mantains a list of running replications + // This maintains a list of running replications replications []*replication replicationsMU sync.RWMutex } diff --git a/x/fsdb/doc.go b/x/fsdb/doc.go index e9a0334b7..3280c0d81 100644 --- a/x/fsdb/doc.go +++ b/x/fsdb/doc.go @@ -18,7 +18,7 @@ https://github.com/go-kivik/kivik/x/fsdb Bug reports, feature requests, and pull requests are always welcome. Current development is primarily focused around using fsdb for testing of CouchDB -applications, and bootstraping CouchDB applications. +applications, and bootstrapping CouchDB applications. # General Usage diff --git a/x/fsdb/filesystem/fs.go b/x/fsdb/filesystem/fs.go index 4531276b8..fc77aa771 100644 --- a/x/fsdb/filesystem/fs.go +++ b/x/fsdb/filesystem/fs.go @@ -18,7 +18,7 @@ import ( "os" ) -// Filesystem is a filesystem implemenatation. +// Filesystem is a filesystem implementation. type Filesystem interface { Mkdir(name string, perm os.FileMode) error MkdirAll(path string, perm os.FileMode) error diff --git a/x/fsdb/put.go b/x/fsdb/put.go index 2b099c22f..f18ebca0b 100644 --- a/x/fsdb/put.go +++ b/x/fsdb/put.go @@ -84,7 +84,7 @@ func (d *db) Put(ctx context.Context, docID string, i interface{}, options drive doc, err := d.cdb.OpenDocID(docID, options) switch { case kivik.HTTPStatus(err) == http.StatusNotFound: - // Crate new doc + // Create new doc doc = d.cdb.NewDocument(docID) case err != nil: return "", err diff --git a/x/fsdb/testdata/TestGet_non-standard_filenames b/x/fsdb/testdata/TestGet_non-standard_filenames index 225e5ff9c..a09dc46c4 100644 --- a/x/fsdb/testdata/TestGet_non-standard_filenames +++ b/x/fsdb/testdata/TestGet_non-standard_filenames @@ -38,7 +38,7 @@ }, "_id": "note-i_ɪ", "_rev": "1-", - "crated": "2019-08-27T16:30:25Z", + "created": "2019-08-27T16:30:25Z", "fieldValues": [ { "text": "i" diff --git "a/x/fsdb/testdata/db_nonascii/note-i_\311\252.yaml" "b/x/fsdb/testdata/db_nonascii/note-i_\311\252.yaml" index a433dfa2d..d380138f1 100644 --- "a/x/fsdb/testdata/db_nonascii/note-i_\311\252.yaml" +++ "b/x/fsdb/testdata/db_nonascii/note-i_\311\252.yaml" @@ -10,7 +10,7 @@ _attachments: content_type: image/jpeg bean.ogg: content_type: audio/ogg -crated: 2019-08-27T16:30:25Z +created: 2019-08-27T16:30:25Z modified: 2019-08-27T16:30:25Z model: 0 theme: theme-minimalpairs diff --git a/x/sqlite/json.go b/x/sqlite/json.go index 2e62e7ebd..44d7d2e6d 100644 --- a/x/sqlite/json.go +++ b/x/sqlite/json.go @@ -412,7 +412,7 @@ func (d fullDoc) rev() (revision, error) { } // renders only the requested fields. If fields is is empty, -// the entire docuemnt is returned. +// the entire document is returned. func (d *fullDoc) toRaw(fields ...string) json.RawMessage { want := func(string) bool { return true } if len(fields) > 0 { diff --git a/x/sqlite/query_test.go b/x/sqlite/query_test.go index 2f54fae93..7058a2e84 100644 --- a/x/sqlite/query_test.go +++ b/x/sqlite/query_test.go @@ -1493,10 +1493,10 @@ func TestDBQuery(t *testing.T) { }, }, }) - // Returned results are implcitly ordered, due to the ordering of + // Returned results are implicitly ordered, due to the ordering of // the index on the `id` column for joins. So we need to insert // a key that sorts differently implicitly (with ASCII ordering) than - // explcitly (with CouchDB's UCI ordering). Thus the `~` id/key. In + // explicitly (with CouchDB's UCI ordering). Thus the `~` id/key. In // ASCII, ~ comes after the alphabet, in UCI it comes first. So we // expect it to come after, with implicit ordering, or after, with // explicit. Comment out the options line below to see the difference. diff --git a/x/sqlite/views_test.go b/x/sqlite/views_test.go index d180e5a8c..1c580e4f5 100644 --- a/x/sqlite/views_test.go +++ b/x/sqlite/views_test.go @@ -601,10 +601,10 @@ func TestDBAllDocs(t *testing.T) { }) tests.Add("return unsorted results", func(t *testing.T) interface{} { d := newDB(t) - // Returned results are implcitly ordered, due to the ordering of + // Returned results are implicitly ordered, due to the ordering of // the index on the `id` column for joins. So we need to insert // a key that sorts differently implicitly (with ASCII ordering) than - // explcitly (with CouchDB's UCI ordering). Thus the `~` id/key. In + // explicitly (with CouchDB's UCI ordering). Thus the `~` id/key. In // ASCII, ~ comes after the alphabet, in UCI it comes first. So we // expect it to come after, with implicit ordering, or after, with // explicit. Comment out the options line below to see the difference.