chore: fix grammar and typos in comments (#5279)

This commit is contained in:
Gregor Fischer
2025-11-16 12:27:17 +01:00
committed by GitHub
parent 866613af8c
commit 052de3b552
8 changed files with 9 additions and 9 deletions

View File

@@ -40,7 +40,7 @@ type (
} }
) )
// New create a Filter, store is the backed redis, key is the key for the bloom filter, // New creates a Filter, store is the backed redis, key is the key for the bloom filter,
// bits is how many bits will be used, maps is how many hashes for each addition. // bits is how many bits will be used, maps is how many hashes for each addition.
// best practices: // best practices:
// elements - means how many actual elements // elements - means how many actual elements

View File

@@ -168,7 +168,7 @@ func (s Stream) Count() (count int) {
return return
} }
// Distinct removes the duplicated items base on the given KeyFunc. // Distinct removes the duplicated items based on the given KeyFunc.
func (s Stream) Distinct(fn KeyFunc) Stream { func (s Stream) Distinct(fn KeyFunc) Stream {
source := make(chan any) source := make(chan any)
@@ -459,7 +459,7 @@ func (s Stream) Tail(n int64) Stream {
return Range(source) return Range(source)
} }
// Walk lets the callers handle each item, the caller may write zero, one or more items base on the given item. // Walk lets the callers handle each item, the caller may write zero, one or more items based on the given item.
func (s Stream) Walk(fn WalkFunc, opts ...Option) Stream { func (s Stream) Walk(fn WalkFunc, opts ...Option) Stream {
option := buildOptions(opts...) option := buildOptions(opts...)
if option.unlimitedWorkers { if option.unlimitedWorkers {

View File

@@ -96,7 +96,7 @@ func (h *ConsistentHash) AddWithWeight(node any, weight int) {
h.AddWithReplicas(node, replicas) h.AddWithReplicas(node, replicas)
} }
// Get returns the corresponding node from h base on the given v. // Get returns the corresponding node from h based on the given v.
func (h *ConsistentHash) Get(v any) (any, bool) { func (h *ConsistentHash) Get(v any) (any, bool) {
h.lock.RLock() h.lock.RLock()
defer h.lock.RUnlock() defer h.lock.RUnlock()

View File

@@ -66,7 +66,7 @@ type (
gzip bool gzip bool
} }
// SizeLimitRotateRule a rotation rule that make the log file rotated base on size // SizeLimitRotateRule a rotation rule that makes the log file rotated based on size
SizeLimitRotateRule struct { SizeLimitRotateRule struct {
DailyRotateRule DailyRotateRule
maxSize int64 maxSize int64

View File

@@ -6,7 +6,7 @@ import (
"time" "time"
) )
// An Unstable is used to generate random value around the mean value base on given deviation. // An Unstable is used to generate random value around the mean value based on given deviation.
type Unstable struct { type Unstable struct {
deviation float64 deviation float64
r *rand.Rand r *rand.Rand

View File

@@ -43,7 +43,7 @@ func AddProbe(probe Probe) {
defaultHealthManager.addProbe(probe) defaultHealthManager.addProbe(probe)
} }
// CreateHttpHandler create health http handler base on given probe. // CreateHttpHandler creates a health http handler based on the given probe.
func CreateHttpHandler(healthResponse string) http.HandlerFunc { func CreateHttpHandler(healthResponse string) http.HandlerFunc {
return func(w http.ResponseWriter, _ *http.Request) { return func(w http.ResponseWriter, _ *http.Request) {
if defaultHealthManager.IsReady() { if defaultHealthManager.IsReady() {

View File

@@ -36,7 +36,7 @@ func DocCommand(_ *cobra.Command, _ []string) error {
} }
if !pathx.FileExists(dir) { if !pathx.FileExists(dir) {
return fmt.Errorf("dir %s not exsit", dir) return fmt.Errorf("dir %s not exist", dir)
} }
dir, err := filepath.Abs(dir) dir, err := filepath.Abs(dir)

View File

@@ -11,7 +11,7 @@
## swagger ## swagger
1. [bug fix] remove example generation when request body are `query`, `path` and `header` 1. [bug fix] remove example generation when request body are `query`, `path` and `header`
- it not supported in api spec 2.0 - it not supported in api spec 2.0
- it's will generate example when request body is json format. - it will generate example when request body is json format.
2. [features] swagger generation supported definitions 2. [features] swagger generation supported definitions
- supported response definitions - supported response definitions
- supported json request body definitions - supported json request body definitions