Modify comment syntax error (#2572)

This commit is contained in:
王哈哈
2022-11-04 21:55:17 +08:00
committed by GitHub
parent 3db64c7d47
commit dac3600b53
24 changed files with 32 additions and 32 deletions

View File

@@ -29,7 +29,7 @@ func NewSet() *Set {
}
}
// NewUnmanagedSet returns a unmanaged Set, which can put values with different types.
// NewUnmanagedSet returns an unmanaged Set, which can put values with different types.
func NewUnmanagedSet() *Set {
return &Set{
data: make(map[interface{}]lang.PlaceholderType),

View File

@@ -13,7 +13,7 @@ type (
// SubOption defines the method to customize a Subscriber.
SubOption func(sub *Subscriber)
// A Subscriber is used to subscribe the given key on a etcd cluster.
// A Subscriber is used to subscribe the given key on an etcd cluster.
Subscriber struct {
endpoints []string
exclusive bool

View File

@@ -328,7 +328,7 @@ func (s Stream) Parallel(fn ParallelFunc, opts ...Option) {
}, opts...).Done()
}
// Reduce is a utility method to let the caller deal with the underlying channel.
// Reduce is an utility method to let the caller deal with the underlying channel.
func (s Stream) Reduce(fn ReduceFunc) (interface{}, error) {
return fn(s.source)
}

View File

@@ -10,7 +10,7 @@ func (nopCloser) Close() error {
return nil
}
// NopCloser returns a io.WriteCloser that does nothing on calling Close.
// NopCloser returns an io.WriteCloser that does nothing on calling Close.
func NopCloser(w io.Writer) io.WriteCloser {
return nopCloser{w}
}

View File

@@ -41,7 +41,7 @@ type (
opts unmarshalOptions
}
// UnmarshalOption defines the method to customize a Unmarshaler.
// UnmarshalOption defines the method to customize an Unmarshaler.
UnmarshalOption func(*unmarshalOptions)
unmarshalOptions struct {
@@ -50,7 +50,7 @@ type (
}
)
// NewUnmarshaler returns a Unmarshaler.
// NewUnmarshaler returns an Unmarshaler.
func NewUnmarshaler(key string, opts ...UnmarshalOption) *Unmarshaler {
unmarshaler := Unmarshaler{
key: key,
@@ -724,14 +724,14 @@ func (u *Unmarshaler) parseOptionsWithContext(field reflect.StructField, m Value
return key, optsWithContext, nil
}
// WithStringValues customizes a Unmarshaler with number values from strings.
// WithStringValues customizes an Unmarshaler with number values from strings.
func WithStringValues() UnmarshalOption {
return func(opt *unmarshalOptions) {
opt.fromString = true
}
}
// WithCanonicalKeyFunc customizes a Unmarshaler with Canonical Key func
// WithCanonicalKeyFunc customizes an Unmarshaler with Canonical Key func
func WithCanonicalKeyFunc(f func(string) string) UnmarshalOption {
return func(opt *unmarshalOptions) {
opt.canonicalKey = f

View File

@@ -6,14 +6,14 @@ import (
"time"
)
// A 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 base on given deviation.
type Unstable struct {
deviation float64
r *rand.Rand
lock *sync.Mutex
}
// NewUnstable returns a Unstable.
// NewUnstable returns an Unstable.
func NewUnstable(deviation float64) Unstable {
if deviation < 0 {
deviation = 0

View File

@@ -258,7 +258,7 @@ func parseUints(val string) ([]uint64, error) {
return sets, nil
}
// runningInUserNS detects whether we are currently running in a user namespace.
// runningInUserNS detects whether we are currently running in an user namespace.
func runningInUserNS() bool {
nsOnce.Do(func() {
file, err := os.Open("/proc/self/uid_map")

View File

@@ -34,14 +34,14 @@ func newOptions(opts ...Option) Options {
return o
}
// WithExpiry returns a func to customize a Options with given expiry.
// WithExpiry returns a func to customize an Options with given expiry.
func WithExpiry(expiry time.Duration) Option {
return func(o *Options) {
o.Expiry = expiry
}
}
// WithNotFoundExpiry returns a func to customize a Options with given not found expiry.
// WithNotFoundExpiry returns a func to customize an Options with given not found expiry.
func WithNotFoundExpiry(expiry time.Duration) Option {
return func(o *Options) {
o.NotFoundExpiry = expiry

View File

@@ -8,7 +8,7 @@ import (
"github.com/zeromicro/go-zero/core/stores/redis"
)
// CreateRedis returns a in process redis.Redis.
// CreateRedis returns an in process redis.Redis.
func CreateRedis() (r *redis.Redis, clean func(), err error) {
mr, err := miniredis.Run()
if err != nil {

View File

@@ -2,7 +2,7 @@ package syncx
import "sync/atomic"
// A OnceGuard is used to make sure a resource can be taken once.
// An OnceGuard is used to make sure a resource can be taken once.
type OnceGuard struct {
done uint32
}

View File

@@ -29,7 +29,7 @@ var (
tp *sdktrace.TracerProvider
)
// StartAgent starts a opentelemetry agent.
// StartAgent starts an opentelemetry agent.
func StartAgent(c Config) {
lock.Lock()
defer lock.Unlock()

View File

@@ -3,7 +3,7 @@ package trace
// TraceName represents the tracing name.
const TraceName = "go-zero"
// A Config is a opentelemetry config.
// A Config is an opentelemetry config.
type Config struct {
Name string `json:",optional"`
Endpoint string `json:",optional"`

View File

@@ -7,12 +7,12 @@ import (
"github.com/zeromicro/go-zero/core/timex"
)
// A ElapsedTimer is a timer to track the elapsed time.
// An ElapsedTimer is a timer to track the elapsed time.
type ElapsedTimer struct {
start time.Duration
}
// NewElapsedTimer returns a ElapsedTimer.
// NewElapsedTimer returns an ElapsedTimer.
func NewElapsedTimer() *ElapsedTimer {
return &ElapsedTimer{
start: timex.Now(),

View File

@@ -2,7 +2,7 @@ package utils
import "github.com/google/uuid"
// NewUuid returns a uuid string.
// NewUuid returns an uuid string.
func NewUuid() string {
return uuid.New().String()
}