From 3412ebbb5d0358964de8d048c6fcc66d9b95dad8 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Tue, 18 Jul 2023 12:23:57 +0300 Subject: [PATCH] fix comments --- data/consts.go | 4 ++-- process/elasticproc/converters/field.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/consts.go b/data/consts.go index 594da63c..ad94545c 100644 --- a/data/consts.go +++ b/data/consts.go @@ -9,6 +9,6 @@ const ( // MaxFieldLength defines the maximum length for a keyword field, approximating the maximum length of the keyword type. MaxFieldLength = 30000 - // MaxLengthForBase64EncodedFields defines the maximum length for a keyboard field that will be base64 encoded - MaxLengthForBase64EncodedFields = 22500 + // MaxKeywordFieldLengthBeforeBase64Encoding defines the maximum length for a keyword field that will be base64 encoded + MaxKeywordFieldLengthBeforeBase64Encoding = 22500 ) diff --git a/process/elasticproc/converters/field.go b/process/elasticproc/converters/field.go index e054dd45..d96d3571 100644 --- a/process/elasticproc/converters/field.go +++ b/process/elasticproc/converters/field.go @@ -11,11 +11,11 @@ func TruncateFieldIfExceedsMaxLength(field string) string { return field } -// TruncateFieldIfExceedsMaxLengthBase64 will truncate the provided field if the max length exceeds +// TruncateFieldIfExceedsMaxLengthBase64 will truncate the provided field if the max length after base64 encoding would be exceeded // this function will be used for the fields that after will be base64 encoded func TruncateFieldIfExceedsMaxLengthBase64(field string) string { - if len(field) > data.MaxLengthForBase64EncodedFields { - return field[:data.MaxLengthForBase64EncodedFields] + if len(field) > data.MaxKeywordFieldLengthBeforeBase64Encoding { + return field[:data.MaxKeywordFieldLengthBeforeBase64Encoding] } return field