diff --git a/libs/closers/log.go b/libs/closers/log.go index 0c60dad07..3cac013e4 100644 --- a/libs/closers/log.go +++ b/libs/closers/log.go @@ -7,7 +7,7 @@ import ( loggingutils "github.com/brave-intl/bat-go/libs/logging" ) -// Log calls Close on the specified closer, panicing on error +// Log calls Close on the specified closer, panicking on error func Log(ctx context.Context, c io.Closer) { // get the logger from the context logger := loggingutils.Logger(ctx, "closer.Log") diff --git a/libs/closers/panic.go b/libs/closers/panic.go index 73176d146..4e1263da2 100644 --- a/libs/closers/panic.go +++ b/libs/closers/panic.go @@ -8,7 +8,7 @@ import ( "github.com/brave-intl/bat-go/libs/logging" ) -// Panic calls Close on the specified closer, panicing on error +// Panic calls Close on the specified closer, panicking on error func Panic(ctx context.Context, c io.Closer) { logger := logging.Logger(ctx, "closers.Panic") if c == nil { diff --git a/libs/kv/kv_test.go b/libs/kv/kv_test.go index c427b57bc..1773fde26 100644 --- a/libs/kv/kv_test.go +++ b/libs/kv/kv_test.go @@ -27,7 +27,7 @@ func TestMapKv(t *testing.T) { } if _, err := store.Get("DEAD"); err == nil { - t.Error("Get should return an error on nonexistant key") + t.Error("Get should return an error on nonexistent key") } if r, err := store.Delete("FOO"); !r || err != nil { diff --git a/services/ratios/cmd/rest_run.go b/services/ratios/cmd/rest_run.go index c6b315ef7..d764d388c 100644 --- a/services/ratios/cmd/rest_run.go +++ b/services/ratios/cmd/rest_run.go @@ -49,7 +49,7 @@ func RestRun(command *cobra.Command, args []string) { // setup the service now ctx, s, err := ratios.InitService(ctx) if err != nil { - logger.Fatal().Err(err).Msg("failed to initalize ratios service") + logger.Fatal().Err(err).Msg("failed to initialize ratios service") } // do rest endpoints diff --git a/services/ratios/inputs.go b/services/ratios/inputs.go index 1bc53b69b..4fcaecb8b 100644 --- a/services/ratios/inputs.go +++ b/services/ratios/inputs.go @@ -18,7 +18,7 @@ type CoingeckoCoin struct { coin string } -// String - stringer implmentation +// String - stringer implementation func (cc *CoingeckoCoin) String() string { return string(cc.coin) } @@ -79,7 +79,7 @@ var ( // CoingeckoCoinList - type for coingecko coin list input type CoingeckoCoinList []CoingeckoCoin -// String - stringer implmentation +// String - stringer implementation func (ccl *CoingeckoCoinList) String() string { var s []string for _, coin := range *ccl { @@ -127,7 +127,7 @@ func (ccl *CoingeckoCoinList) Validate(ctx context.Context) error { // CoingeckoVsCurrency - type for coingecko vs currency input type CoingeckoVsCurrency string -// String - stringer implmentation +// String - stringer implementation func (cvc *CoingeckoVsCurrency) String() string { return string(*cvc) } @@ -168,7 +168,7 @@ var ( // CoingeckoVsCurrencyList - type for coingecko vs currency list input type CoingeckoVsCurrencyList []CoingeckoVsCurrency -// String - stringer implmentation +// String - stringer implementation func (cvcl *CoingeckoVsCurrencyList) String() string { var s []string for _, vc := range *cvcl { @@ -211,7 +211,7 @@ func (cvcl *CoingeckoVsCurrencyList) Validate(ctx context.Context) error { // CoingeckoDuration - type for coingecko duration input type CoingeckoDuration string -// String - stringer implmentation +// String - stringer implementation func (cd *CoingeckoDuration) String() string { return string(*cd) } @@ -289,12 +289,12 @@ func (cd *CoingeckoDuration) Validate(ctx context.Context) error { // Note: we only will request the first page type CoingeckoLimit int -// String - stringer implmentation +// String - stringer implementation func (cl *CoingeckoLimit) String() string { return strconv.Itoa(int(*cl)) } -// Int - int conversion implmentation +// Int - int conversion implementation func (cl *CoingeckoLimit) Int() int { return int(*cl) } diff --git a/services/rewards/inputs.go b/services/rewards/inputs.go index 6a6b1e4f1..d64179c66 100644 --- a/services/rewards/inputs.go +++ b/services/rewards/inputs.go @@ -10,7 +10,7 @@ import ( // BaseCurrency - type for base currency input type BaseCurrency string -// String - stringer implmentation +// String - stringer implementation func (rbc *BaseCurrency) String() string { return string(*rbc) } diff --git a/services/skus/service.go b/services/skus/service.go index c2a2b29aa..f830f643b 100644 --- a/services/skus/service.go +++ b/services/skus/service.go @@ -1080,7 +1080,7 @@ func (s *Service) CreateTransactionFromRequest(ctx context.Context, req CreateTr return nil, errorutils.Wrap(err, "error validating order is paid") } - // If the transaction that was satisifies the order then let's update the status + // If the transaction that was satisfies the order then let's update the status if isPaid { err = s.Datastore.UpdateOrder(transaction.OrderID, "paid") if err != nil { @@ -1092,7 +1092,7 @@ func (s *Service) CreateTransactionFromRequest(ctx context.Context, req CreateTr return transaction, err } -// UpdateTransactionFromRequest queries the endpoints and creates a transaciton +// UpdateTransactionFromRequest queries the endpoints and creates a transaction func (s *Service) UpdateTransactionFromRequest(ctx context.Context, req CreateTransactionRequest, orderID uuid.UUID, getCustodialTx getCustodialTxFn) (*Transaction, error) { sublogger := logging.Logger(ctx, "payments").With(). @@ -1118,7 +1118,7 @@ func (s *Service) UpdateTransactionFromRequest(ctx context.Context, req CreateTr return nil, errorutils.Wrap(err, "error validating order is paid") } - // If the transaction that was satisifies the order then let's update the status + // If the transaction that was satisfies the order then let's update the status if isPaid { err = s.Datastore.UpdateOrder(transaction.OrderID, "paid") if err != nil { @@ -2245,7 +2245,7 @@ func (s *Service) redeemBlindedCred(ctx context.Context, w http.ResponseWriter, case timeLimitedV2: redeemFn = s.cbClient.RedeemCredentialV3 default: - return handlers.WrapError(fmt.Errorf("credential type %s not suppoted", kind), "unknown credential type %s", http.StatusBadRequest) + return handlers.WrapError(fmt.Errorf("credential type %s not supported", kind), "unknown credential type %s", http.StatusBadRequest) } // FIXME: we shouldn't be using the issuer as the payload, it ideally would be a unique request identifier diff --git a/services/skus/storage/repository/repository.go b/services/skus/storage/repository/repository.go index 97e408fa3..69769e19d 100644 --- a/services/skus/storage/repository/repository.go +++ b/services/skus/storage/repository/repository.go @@ -143,7 +143,7 @@ func (r *Order) GetTimeBounds(ctx context.Context, dbi sqlx.QueryerContext, id u // GetExpiresAtAfterISOPeriod returns a new value for expires_at that is last_paid_at plus ISO period. // // It falls back to now() when last_paid_at is NULL. -// It uses the maximum of the order items' valid_for_iso as inverval, and falls back to 1 month. +// It uses the maximum of the order items' valid_for_iso as interval, and falls back to 1 month. func (r *Order) GetExpiresAtAfterISOPeriod(ctx context.Context, dbi sqlx.QueryerContext, id uuid.UUID) (time.Time, error) { const q = `SELECT COALESCE(last_paid_at, now()) + (SELECT COALESCE(MAX(valid_for_iso::interval), interval '1 month') FROM order_items WHERE order_id = $2) diff --git a/services/wallet/datastore.go b/services/wallet/datastore.go index 00699a904..f0e6f3971 100644 --- a/services/wallet/datastore.go +++ b/services/wallet/datastore.go @@ -974,7 +974,7 @@ func (pg *Postgres) ConnectCustodialWallet(ctx context.Context, cl *CustodianLin ); err != nil { sublogger.Error().Err(err). Msg("failed to update wallets with new deposit destination") - return fmt.Errorf("error updating wallets with new deposit desintation: %w", err) + return fmt.Errorf("error updating wallets with new deposit destination: %w", err) } else if r != nil { count, _ := r.RowsAffected() if count < 1 {