Skip to content

Commit

Permalink
Drop some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlion committed Jul 26, 2024
1 parent 333b288 commit f6940e7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions internal/irzstd/irzstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ func (w *Writer) Close() error {
// Returns:
// - err: Error opening IR writer, error IR buffer not empty, error with type assertion
func (w *Writer) Reset() error {
// Make a new IR writer to get new preamble.
var err error
w.irWriter, err = ir.NewWriterSize[ir.FourByteEncoding](w.size, w.timezone)
if err != nil {
Expand Down Expand Up @@ -217,7 +216,6 @@ func (w *Writer) Reset() error {
return err
}

// Re-initialize Zstd writer to receive more input.
w.zstdWriter.Reset(w.zstdBuffer)

return nil
Expand Down
5 changes: 0 additions & 5 deletions plugins/out_clp_s3/flush/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ func decodeMsgpack(dec *codec.Decoder, config outctx.S3Config) ([]ffi.LogEvent,
var logEvents []ffi.LogEvent
for {
ts, record, err := decoder.GetRecord(dec)

// If chunk finished will exit loop and err is io.EOF
if err != nil {
return logEvents, err
}
Expand Down Expand Up @@ -242,12 +240,10 @@ func decodeTs(ts any) time.Time {
// - msg: Retrieved message
// - err: Key not found, json.Unmarshal error, string type assertion error
func getMessage(jsonRecord []byte, config outctx.S3Config) (string, error) {
// If use_single_key=false, return the entire record.
if !config.UseSingleKey {
return string(jsonRecord), nil
}

// If use_single_key=true, then look for key in record, and set message to the key's value.
var record map[string]any
err := json.Unmarshal(jsonRecord, &record)
if err != nil {
Expand All @@ -261,7 +257,6 @@ func getMessage(jsonRecord []byte, config outctx.S3Config) (string, error) {
if config.AllowMissingKey {
return string(jsonRecord), nil
}
// If key not found in record and allow_missing_key=false, then return an error.
return "", fmt.Errorf("key %s not found in record %v", config.SingleKey, record)
}

Expand Down

0 comments on commit f6940e7

Please sign in to comment.