Skip to content

Commit

Permalink
chore: remove duplicate select block (openGemini#142)
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangJian He <shoothzj@gmail.com>
  • Loading branch information
ZhangJian He authored Aug 4, 2024
1 parent 4374b8b commit d30e02c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion opengemini/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (enc *LineProtocolEncoder) writeByte(b byte) error {
}

// writeString writes a string to the underlying writer, escaping characters
// with a backslash if necessary. Note that, for simplity, `charsToEscape` can
// with a backslash if necessary. Note that, for simplify, `charsToEscape` can
// only contain ASCII characters.
func (enc *LineProtocolEncoder) writeString(s string, charsToEscape string) error {
for i := 0; i < len(s); i++ {
Expand Down
9 changes: 2 additions & 7 deletions opengemini/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
type WriteCallback func(error)

// CallbackDummy if user don't want to handle WritePoint error, could use this function as empty callback
func CallbackDummy(error) {
func CallbackDummy(_ error) {
// Do nothing
}

Expand Down Expand Up @@ -50,12 +50,7 @@ func (c *client) WritePointWithRp(database string, rp string, point *Point, call
if loaded {
close(newCollection)
} else {
select {
case <-c.batchContext.Done():
return c.batchContext.Err()
default:
go c.internalBatchSend(c.batchContext, database, rp, actual.(chan *sendBatchWithCB))
}
go c.internalBatchSend(c.batchContext, database, rp, actual.(chan *sendBatchWithCB))
}
value = actual
}
Expand Down

0 comments on commit d30e02c

Please sign in to comment.