Skip to content

Commit

Permalink
Merge pull request #1032 from deining/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
flimzy authored Jul 22, 2024
2 parents b4d9fec + 7e8d5ff commit 958ade9
Show file tree
Hide file tree
Showing 26 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion cmd/kivik/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down
2 changes: 1 addition & 1 deletion couchdb/chttp/chttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion couchdb/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
2 changes: 1 addition & 1 deletion couchdb/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions couchdb/iter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion couchdb/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion couchdb/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions driver/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
2 changes: 1 addition & 1 deletion int/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kiviktest/client/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pouchdb/bindings/pouchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion pouchdb/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pouchdb/find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{
Expand Down
2 changes: 1 addition & 1 deletion pouchdb/pouchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion x/fsdb/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/fsdb/filesystem/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/fsdb/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/fsdb/testdata/TestGet_non-standard_filenames
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"_id": "note-i_ɪ",
"_rev": "1-",
"crated": "2019-08-27T16:30:25Z",
"created": "2019-08-27T16:30:25Z",
"fieldValues": [
{
"text": "i"
Expand Down
2 changes: 1 addition & 1 deletion x/fsdb/testdata/db_nonascii/note-i_ɪ.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions x/sqlite/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions x/sqlite/views_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 958ade9

Please sign in to comment.