From 9cbb2e750e61884670f093679474ade47d429caf Mon Sep 17 00:00:00 2001 From: Jan Lauber Date: Mon, 17 Oct 2022 19:17:44 +0200 Subject: [PATCH] [#794] fixed comment typos --- core/base.go | 2 +- daos/collection.go | 2 +- daos/user.go | 2 +- forms/admin_upsert_test.go | 4 ++-- models/schema/schema_field.go | 2 +- tools/search/filter.go | 5 +++-- tools/search/provider.go | 3 ++- tools/subscriptions/client.go | 2 +- tools/types/datetime.go | 2 +- tools/types/json_array.go | 2 +- tools/types/json_map.go | 2 +- 11 files changed, 15 insertions(+), 13 deletions(-) diff --git a/core/base.go b/core/base.go index b5574977..708fe965 100644 --- a/core/base.go +++ b/core/base.go @@ -125,7 +125,7 @@ type BaseApp struct { // NewBaseApp creates and returns a new BaseApp instance // configured with the provided arguments. // -// To initialize the app, you need to call `app.Bootsrap()`. +// To initialize the app, you need to call `app.Bootstrap()`. func NewBaseApp(dataDir string, encryptionEnv string, isDebug bool) *BaseApp { app := &BaseApp{ dataDir: dataDir, diff --git a/daos/collection.go b/daos/collection.go index 0e1e3b41..104cf887 100644 --- a/daos/collection.go +++ b/daos/collection.go @@ -76,7 +76,7 @@ func (dao *Dao) FindCollectionsWithUserFields() ([]*models.Collection, error) { // relation schema fields referencing the provided collection. // // If the provided collection has reference to itself then it will be -// also included in the result. To exlude it, pass the collection id +// also included in the result. To exclude it, pass the collection id // as the excludeId argument. func (dao *Dao) FindCollectionReferences(collection *models.Collection, excludeId string) (map[*models.Collection][]*schema.SchemaField, error) { collections := []*models.Collection{} diff --git a/daos/user.go b/daos/user.go index 65f8c740..33ddd285 100644 --- a/daos/user.go +++ b/daos/user.go @@ -35,7 +35,7 @@ func (dao *Dao) LoadProfile(user *models.User) error { return nil } -// LoadProfiles loads the profile records associated to the provied users list. +// LoadProfiles loads the profile records associated to the provided users list. func (dao *Dao) LoadProfiles(users []*models.User) error { collection, err := dao.FindCollectionByNameOrId(models.ProfileCollectionName) if err != nil { diff --git a/forms/admin_upsert_test.go b/forms/admin_upsert_test.go index 4c7c9ea6..2ec6c42e 100644 --- a/forms/admin_upsert_test.go +++ b/forms/admin_upsert_test.go @@ -241,7 +241,7 @@ func TestAdminUpsertSubmit(t *testing.T) { true, }, { - // update succcess - new email + // update success - new email "2b4a97cc-3f83-4d01-a26b-3d77bc842d3c", `{ "email": "test_update@example.com" @@ -249,7 +249,7 @@ func TestAdminUpsertSubmit(t *testing.T) { false, }, { - // update succcess - new password + // update success - new password "2b4a97cc-3f83-4d01-a26b-3d77bc842d3c", `{ "password": "1234567890", diff --git a/models/schema/schema_field.go b/models/schema/schema_field.go index f4964557..dd8e772d 100644 --- a/models/schema/schema_field.go +++ b/models/schema/schema_field.go @@ -133,7 +133,7 @@ func (f SchemaField) Validate() error { // init field options (if not already) f.InitOptions() - // add commonly used filter literals to the exlude names list + // add commonly used filter literals to the exclude names list excludeNames := ReservedFieldNames() excludeNames = append(excludeNames, "null", "true", "false") diff --git a/tools/search/filter.go b/tools/search/filter.go index c7b02713..5db97b8e 100644 --- a/tools/search/filter.go +++ b/tools/search/filter.go @@ -13,16 +13,17 @@ import ( "github.com/spf13/cast" ) -// FilterData is a filter expession string following the `fexpr` package grammar. +// FilterData is a filter expression string following the `fexpr` package grammar. // // Example: +// // var filter FilterData = "id = null || (name = 'test' && status = true)" // resolver := search.NewSimpleFieldResolver("id", "name", "status") // expr, err := filter.BuildExpr(resolver) type FilterData string // parsedFilterData holds a cache with previously parsed filter data expressions -// (initialized with some prealocated empty data map) +// (initialized with some preallocated empty data map) var parsedFilterData = store.New(make(map[string][]fexpr.ExprGroup, 50)) // BuildExpr parses the current filter data and returns a new db WHERE expression. diff --git a/tools/search/provider.go b/tools/search/provider.go index 095bbac6..24379052 100644 --- a/tools/search/provider.go +++ b/tools/search/provider.go @@ -46,6 +46,7 @@ type Provider struct { // NewProvider creates and returns a new search provider. // // Example: +// // baseQuery := db.Select("*").From("user") // fieldResolver := search.NewSimpleFieldResolver("id", "name") // models := []*YourDataStruct{} @@ -241,7 +242,7 @@ func (s *Provider) Exec(items any) (*Result, error) { }, nil } -// ParseAndExec is a short conventient method to trigger both +// ParseAndExec is a short convenient method to trigger both // `Parse()` and `Exec()` in a single call. func (s *Provider) ParseAndExec(urlQuery string, modelsSlice any) (*Result, error) { if err := s.Parse(urlQuery); err != nil { diff --git a/tools/subscriptions/client.go b/tools/subscriptions/client.go index f95b1c31..49872ef3 100644 --- a/tools/subscriptions/client.go +++ b/tools/subscriptions/client.go @@ -107,7 +107,7 @@ func (c *DefaultClient) Unsubscribe(subs ...string) { delete(c.subscriptions, s) } } else { - // unsubsribe all + // unsubscribe all for s := range c.subscriptions { delete(c.subscriptions, s) } diff --git a/tools/types/datetime.go b/tools/types/datetime.go index cbeca1e9..27c7f736 100644 --- a/tools/types/datetime.go +++ b/tools/types/datetime.go @@ -40,7 +40,7 @@ func (d DateTime) IsZero() bool { return d.Time().IsZero() } -// String serializes the current DateTime instance into a formated +// String serializes the current DateTime instance into a formatted // UTC date string. // // The zero value is serialized to an empty string. diff --git a/tools/types/json_array.go b/tools/types/json_array.go index 5b24c067..6542f4fe 100644 --- a/tools/types/json_array.go +++ b/tools/types/json_array.go @@ -13,7 +13,7 @@ type JsonArray []any func (m JsonArray) MarshalJSON() ([]byte, error) { type alias JsonArray // prevent recursion - // inialize an empty map to ensure that `[]` is returned as json + // initialize an empty map to ensure that `[]` is returned as json if m == nil { m = JsonArray{} } diff --git a/tools/types/json_map.go b/tools/types/json_map.go index f9c49db2..4bec210d 100644 --- a/tools/types/json_map.go +++ b/tools/types/json_map.go @@ -13,7 +13,7 @@ type JsonMap map[string]any func (m JsonMap) MarshalJSON() ([]byte, error) { type alias JsonMap // prevent recursion - // inialize an empty map to ensure that `{}` is returned as json + // initialize an empty map to ensure that `{}` is returned as json if m == nil { m = JsonMap{} }