From f6940e720d7c02d3f83491f1ece66fbc72013a0d Mon Sep 17 00:00:00 2001 From: davidlion Date: Fri, 26 Jul 2024 13:53:17 -0400 Subject: [PATCH] Drop some comments. --- internal/irzstd/irzstd.go | 2 -- plugins/out_clp_s3/flush/flush.go | 5 ----- 2 files changed, 7 deletions(-) diff --git a/internal/irzstd/irzstd.go b/internal/irzstd/irzstd.go index 509c3af..8ece84f 100644 --- a/internal/irzstd/irzstd.go +++ b/internal/irzstd/irzstd.go @@ -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 { @@ -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 diff --git a/plugins/out_clp_s3/flush/flush.go b/plugins/out_clp_s3/flush/flush.go index e5fc0c0..b7b2c20 100644 --- a/plugins/out_clp_s3/flush/flush.go +++ b/plugins/out_clp_s3/flush/flush.go @@ -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 } @@ -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 { @@ -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) }