Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit 2f03037

Browse files
committed
improve standard of the document
Signed-off-by: chentanjun <[email protected]>
1 parent 4dffe50 commit 2f03037

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

pkg/errortypes/errortypes.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,37 +90,37 @@ func (s DfError) Error() string {
9090
return fmt.Sprintf("{\"Code\":%d,\"Msg\":\"%s\"}", s.Code, s.Msg)
9191
}
9292

93-
// IsNilError check the error is nil or not.
93+
// IsNilError checks the error is nil or not.
9494
func IsNilError(err error) bool {
9595
return err == nil
9696
}
9797

98-
// IsDataNotFound check the error is the data cannot be found.
98+
// IsDataNotFound checks the error is the data cannot be found.
9999
func IsDataNotFound(err error) bool {
100100
return checkError(err, codeDataNotFound)
101101
}
102102

103-
// IsEmptyValue check the error is the value is empty or nil.
103+
// IsEmptyValue checks the error is the value is empty or nil.
104104
func IsEmptyValue(err error) bool {
105105
return checkError(err, codeEmptyValue)
106106
}
107107

108-
// IsInvalidValue check the error is the value is invalid or not.
108+
// IsInvalidValue checks the error is the value is invalid or not.
109109
func IsInvalidValue(err error) bool {
110110
return checkError(err, codeInvalidValue)
111111
}
112112

113-
// IsNotInitialized check the error is the object is not initialized or not.
113+
// IsNotInitialized checks the error is the object is not initialized or not.
114114
func IsNotInitialized(err error) bool {
115115
return checkError(err, codeNotInitialized)
116116
}
117117

118-
// IsConvertFailed check the error is a conversion error or not.
118+
// IsConvertFailed checks the error is a conversion error or not.
119119
func IsConvertFailed(err error) bool {
120120
return checkError(err, codeConvertFailed)
121121
}
122122

123-
// IsRangeNotSatisfiable check the error is a
123+
// IsRangeNotSatisfiable checks the error is a
124124
// range not exist error or not.
125125
func IsRangeNotSatisfiable(err error) bool {
126126
return checkError(err, codeRangeNotSatisfiable)

pkg/errortypes/supernode_errors.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,47 +47,47 @@ var (
4747
ErrAuthenticationRequired = DfError{codeAuthenticationRequired, "authentication required"}
4848
)
4949

50-
// IsSystemError check the error is a system error or not.
50+
// IsSystemError checks the error is a system error or not.
5151
func IsSystemError(err error) bool {
5252
return checkError(err, codeSystemError)
5353
}
5454

55-
// IsCDNFail check the error is CDNFail or not.
55+
// IsCDNFail checks the error is CDNFail or not.
5656
func IsCDNFail(err error) bool {
5757
return checkError(err, codeCDNFail)
5858
}
5959

60-
// IsCDNWait check the error is CDNWait or not.
60+
// IsCDNWait checks the error is CDNWait or not.
6161
func IsCDNWait(err error) bool {
6262
return checkError(err, codeCDNWait)
6363
}
6464

65-
// IsPeerWait check the error is PeerWait or not.
65+
// IsPeerWait checks the error is PeerWait or not.
6666
func IsPeerWait(err error) bool {
6767
return checkError(err, codePeerWait)
6868
}
6969

70-
// IsUnknowError check the error is UnknowError or not.
70+
// IsUnknowError checks the error is UnknowError or not.
7171
func IsUnknowError(err error) bool {
7272
return checkError(err, codeUnknowError)
7373
}
7474

75-
// IsPeerContinue check the error is PeerContinue or not.
75+
// IsPeerContinue checks the error is PeerContinue or not.
7676
func IsPeerContinue(err error) bool {
7777
return checkError(err, codePeerContinue)
7878
}
7979

80-
// IsURLNotReachable check the error is a url not reachable or not.
80+
// IsURLNotReachable checks the error is a url not reachable or not.
8181
func IsURLNotReachable(err error) bool {
8282
return checkError(err, codeURLNotReachable)
8383
}
8484

85-
// IsTaskIDDuplicate check the error is a TaskIDDuplicate error or not.
85+
// IsTaskIDDuplicate checks the error is a TaskIDDuplicate error or not.
8686
func IsTaskIDDuplicate(err error) bool {
8787
return checkError(err, codeTaskIDDuplicate)
8888
}
8989

90-
// IsAuthenticationRequired check the error is an AuthenticationRequired error or not.
90+
// IsAuthenticationRequired checks the error is an AuthenticationRequired error or not.
9191
func IsAuthenticationRequired(err error) bool {
9292
return checkError(err, codeAuthenticationRequired)
9393
}

pkg/printer/printer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var (
2929
Printer = &StdPrinter{Out: os.Stdout}
3030
)
3131

32-
// StdPrinter output info to console directly.
32+
// StdPrinter outputs info to console directly.
3333
type StdPrinter struct {
3434
Out io.Writer
3535
}

pkg/syncmap/syncmap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func NewSyncMap() *SyncMap {
3939
return &SyncMap{&sync.Map{}}
4040
}
4141

42-
// Add add a key-value pair into the *sync.Map.
42+
// Add adds a key-value pair into the *sync.Map.
4343
// The ErrEmptyValue error will be returned if the key is empty.
4444
func (mmap *SyncMap) Add(key string, value interface{}) error {
4545
if stringutils.IsEmptyStr(key) {

0 commit comments

Comments
 (0)