From a3b5d2593309236af485afd0ccc80003c94334dd Mon Sep 17 00:00:00 2001 From: John Kerl Date: Mon, 16 Feb 2026 13:38:49 -0500 Subject: [PATCH] Neaten some comments (#1973) * comment-neaten * comment-neaten * more --- pkg/auxents/hex.go | 1 - pkg/auxents/lecat.go | 1 - pkg/auxents/termcvt.go | 1 - pkg/auxents/unhex.go | 1 - pkg/bifs/arithmetic.go | 4 --- pkg/bifs/collections.go | 12 --------- pkg/bifs/datetime.go | 5 ---- pkg/bifs/mathlib.go | 4 --- pkg/bifs/percentiles.go | 1 - pkg/bifs/stats.go | 5 ---- pkg/bifs/strings.go | 11 -------- pkg/bifs/types.go | 7 ----- pkg/cli/flatten_unflatten.go | 1 - pkg/cli/option_parse.go | 1 - pkg/cli/option_types.go | 2 -- pkg/dsl/ast_types.go | 3 --- pkg/dsl/cst/assignments.go | 4 --- pkg/dsl/cst/block_exit.go | 3 --- pkg/dsl/cst/blocks.go | 5 ---- pkg/dsl/cst/builtin_function_manager.go | 6 ----- pkg/dsl/cst/builtin_functions.go | 14 ---------- pkg/dsl/cst/collections.go | 4 --- pkg/dsl/cst/cond.go | 1 - pkg/dsl/cst/dump.go | 6 ----- pkg/dsl/cst/emit_emitp.go | 5 ---- pkg/dsl/cst/emitf.go | 2 -- pkg/dsl/cst/evaluable.go | 3 --- pkg/dsl/cst/filter.go | 1 - pkg/dsl/cst/for.go | 6 ----- pkg/dsl/cst/if.go | 2 -- pkg/dsl/cst/keyword_usage.go | 4 --- pkg/dsl/cst/leaves.go | 27 ------------------- pkg/dsl/cst/lvalues.go | 10 ------- pkg/dsl/cst/print.go | 6 ----- pkg/dsl/cst/signature.go | 1 - pkg/dsl/cst/statements.go | 1 - pkg/dsl/cst/tee.go | 4 --- pkg/dsl/cst/udf.go | 3 --- pkg/dsl/cst/uds.go | 3 --- pkg/dsl/cst/validate.go | 3 --- pkg/dsl/cst/while.go | 4 --- pkg/input/record_reader_csv.go | 1 - pkg/lib/ordered_map.go | 6 ----- pkg/lib/regex_test.go | 2 -- pkg/lib/stats.go | 2 -- pkg/lib/time_test.go | 4 --- pkg/mlrval/mlrmap.go | 2 -- pkg/mlrval/mlrmap_accessors.go | 9 ------- pkg/mlrval/mlrmap_json.go | 1 - pkg/mlrval/mlrval_collections.go | 4 --- pkg/mlrval/mlrval_format.go | 6 ----- pkg/mlrval/mlrval_infer.go | 2 -- pkg/mlrval/mlrval_json.go | 16 ----------- pkg/output/file_output_handlers.go | 9 ------- pkg/output/record_writer_json_jsonl.go | 6 ----- pkg/output/record_writer_markdown.go | 1 - pkg/output/record_writer_pprint.go | 1 - pkg/output/record_writer_xtab.go | 1 - pkg/platform/getargs_windows.go | 2 -- pkg/terminals/help/entry.go | 13 --------- pkg/terminals/regtest/entry.go | 1 - pkg/terminals/regtest/regtester.go | 6 ----- pkg/terminals/repl/dsl.go | 1 - pkg/terminals/repl/entry.go | 1 - pkg/terminals/repl/session.go | 2 -- pkg/terminals/repl/types.go | 2 -- pkg/terminals/repl/verbs.go | 21 --------------- pkg/transformers/aaa_transformer_table.go | 2 -- pkg/transformers/altkv.go | 3 --- pkg/transformers/bar.go | 6 ----- pkg/transformers/bootstrap.go | 3 --- pkg/transformers/case.go | 2 -- pkg/transformers/cat.go | 7 ----- pkg/transformers/check.go | 2 -- pkg/transformers/clean_whitespace.go | 8 ------ pkg/transformers/count.go | 5 ---- pkg/transformers/count_similar.go | 4 --- pkg/transformers/cut.go | 4 --- pkg/transformers/decimate.go | 4 --- pkg/transformers/fill_down.go | 5 ---- pkg/transformers/fill_empty.go | 3 --- pkg/transformers/flatten.go | 5 ---- pkg/transformers/format_values.go | 4 --- pkg/transformers/fraction.go | 4 --- pkg/transformers/gap.go | 3 --- pkg/transformers/grep.go | 3 --- pkg/transformers/group_by.go | 3 --- pkg/transformers/group_like.go | 3 --- pkg/transformers/having_fields.go | 6 ----- pkg/transformers/head.go | 3 --- pkg/transformers/histogram.go | 6 ----- pkg/transformers/join.go | 7 ----- pkg/transformers/json_parse.go | 5 ---- pkg/transformers/json_stringify.go | 5 ---- pkg/transformers/label.go | 3 --- pkg/transformers/latin1_to_utf8.go | 3 --- pkg/transformers/merge_fields.go | 4 --- pkg/transformers/most_or_least_frequent.go | 4 --- pkg/transformers/nest.go | 11 -------- pkg/transformers/nothing.go | 2 -- pkg/transformers/put_or_filter.go | 4 --- pkg/transformers/regularize.go | 3 --- pkg/transformers/remove_empty_columns.go | 2 -- pkg/transformers/rename.go | 5 ---- pkg/transformers/reorder.go | 2 -- pkg/transformers/repeat.go | 6 ----- pkg/transformers/reshape.go | 7 ----- pkg/transformers/sample.go | 4 --- pkg/transformers/sec2gmt.go | 3 --- pkg/transformers/sec2gmtdate.go | 3 --- pkg/transformers/seqgen.go | 3 --- pkg/transformers/shuffle.go | 3 --- pkg/transformers/skip_trivial_records.go | 3 --- pkg/transformers/sort.go | 2 -- pkg/transformers/sort_within_records.go | 6 ----- pkg/transformers/sparsify.go | 3 --- pkg/transformers/split.go | 2 -- pkg/transformers/stats1.go | 2 -- pkg/transformers/stats2.go | 6 ----- pkg/transformers/step.go | 9 ------- pkg/transformers/subs.go | 1 - pkg/transformers/summary.go | 3 --- pkg/transformers/surv.go | 1 - pkg/transformers/tac.go | 2 -- pkg/transformers/tail.go | 3 --- pkg/transformers/tee.go | 2 -- pkg/transformers/template.go | 3 --- pkg/transformers/top.go | 4 --- pkg/transformers/unflatten.go | 5 ---- pkg/transformers/uniq.go | 10 ------- pkg/transformers/unspace.go | 2 -- pkg/transformers/unsparsify.go | 5 ---- pkg/transformers/utf8_to_latin1.go | 3 --- pkg/transformers/utils/join_bucket.go | 1 - pkg/transformers/utils/join_bucket_keeper.go | 1 - pkg/transformers/utils/percentile_keeper.go | 4 --- pkg/transformers/utils/stats1_accumulators.go | 19 ------------- pkg/transformers/utils/stats2_accumulators.go | 6 ----- pkg/transformers/utils/top_keeper.go | 2 -- pkg/types/context.go | 1 - pkg/types/mlrval_typing.go | 2 -- scripts/early-multi-language-timings/catgo.go | 2 -- .../early-multi-language-timings/catgo2.go | 2 -- scripts/early-multi-language-timings/cutgo.go | 2 -- 144 files changed, 616 deletions(-) diff --git a/pkg/auxents/hex.go b/pkg/auxents/hex.go index fb48f80ad..742ef44aa 100644 --- a/pkg/auxents/hex.go +++ b/pkg/auxents/hex.go @@ -26,7 +26,6 @@ import ( // 00000070: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f |pqrstuvwxyz{|}~.| // ================================================================ -// ---------------------------------------------------------------- func hexUsage(verbName string, o *os.File, exitCode int) { fmt.Fprintf(o, "Usage: mlr %s [options] {zero or more file names}\n", verbName) fmt.Fprintf(o, "Simple hex-dump.\n") diff --git a/pkg/auxents/lecat.go b/pkg/auxents/lecat.go index 793c93855..d8c605bcf 100644 --- a/pkg/auxents/lecat.go +++ b/pkg/auxents/lecat.go @@ -7,7 +7,6 @@ import ( "os" ) -// ================================================================ func lecatUsage(verbName string, o *os.File, exitCode int) { fmt.Fprintf(o, "Usage: mlr %s [options] {zero or more file names}\n", verbName) fmt.Fprintf(o, "Simply echoes input, but flags CR characters in red and LF characters in green.\n") diff --git a/pkg/auxents/termcvt.go b/pkg/auxents/termcvt.go index 4fbdafc98..4e27ec405 100644 --- a/pkg/auxents/termcvt.go +++ b/pkg/auxents/termcvt.go @@ -8,7 +8,6 @@ import ( "strings" ) -// ================================================================ func termcvtUsage(verbName string, o *os.File, exitCode int) { fmt.Fprintf(o, "Usage: mlr %s [option] {zero or more file names}\n", verbName) fmt.Fprintf(o, "Option (exactly one is required):\n") diff --git a/pkg/auxents/unhex.go b/pkg/auxents/unhex.go index 69a9d03ee..63693ac03 100644 --- a/pkg/auxents/unhex.go +++ b/pkg/auxents/unhex.go @@ -9,7 +9,6 @@ import ( "strings" ) -// ================================================================ func unhexUsage(verbName string, o *os.File, exitCode int) { fmt.Fprintf(o, "Usage: mlr %s [option] {zero or more file names}\n", verbName) fmt.Fprintf(o, "Options:\n") diff --git a/pkg/bifs/arithmetic.go b/pkg/bifs/arithmetic.go index bffcc5309..02f2aa24d 100644 --- a/pkg/bifs/arithmetic.go +++ b/pkg/bifs/arithmetic.go @@ -800,7 +800,6 @@ func BIF_mod_exp(input1, input2, input3 *mlrval.Mlrval) *mlrval.Mlrval { // * absent-null always loses // * empty-null always loses against numbers -// ---------------------------------------------------------------- func min_f_ff(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { var a float64 = input1.AcquireFloatValue() var b float64 = input2.AcquireFloatValue() @@ -939,7 +938,6 @@ func bif_min_unary(input1 *mlrval.Mlrval) *mlrval.Mlrval { return min_unary_dispositions[input1.Type()](input1) } -// ---------------------------------------------------------------- func BIF_minlen_variadic(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) == 0 { return mlrval.VOID @@ -970,7 +968,6 @@ func BIF_minlen_within_map_values(m *mlrval.Mlrmap) *mlrval.Mlrval { return mlrval.FromInt(retval) } -// ---------------------------------------------------------------- func max_f_ff(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { var a float64 = input1.AcquireFloatValue() var b float64 = input2.AcquireFloatValue() @@ -1109,7 +1106,6 @@ func bif_max_unary(input1 *mlrval.Mlrval) *mlrval.Mlrval { return max_unary_dispositions[input1.Type()](input1) } -// ---------------------------------------------------------------- func BIF_maxlen_variadic(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) == 0 { return mlrval.VOID diff --git a/pkg/bifs/collections.go b/pkg/bifs/collections.go index a47730702..65e4544ce 100644 --- a/pkg/bifs/collections.go +++ b/pkg/bifs/collections.go @@ -27,7 +27,6 @@ func BIF_length(input1 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromInt(1) } -// ================================================================ func depth_from_array(input1 *mlrval.Mlrval) *mlrval.Mlrval { maxChildDepth := int64(0) arrayval := input1.AcquireArrayValue() @@ -89,7 +88,6 @@ func BIF_depth(input1 *mlrval.Mlrval) *mlrval.Mlrval { return depth_dispositions[input1.Type()](input1) } -// ================================================================ func leafcount_from_array(input1 *mlrval.Mlrval) *mlrval.Mlrval { sumChildLeafCount := int64(0) arrayval := input1.AcquireArrayValue() @@ -160,7 +158,6 @@ func BIF_leafcount(input1 *mlrval.Mlrval) *mlrval.Mlrval { return leafcount_dispositions[input1.Type()](input1) } -// ---------------------------------------------------------------- func has_key_in_array(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { if input2.IsString() { return mlrval.FALSE @@ -191,7 +188,6 @@ func BIF_haskey(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ================================================================ func BIF_concat(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { output := mlrval.FromEmptyArray() @@ -209,7 +205,6 @@ func BIF_concat(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { return output } -// ================================================================ func BIF_mapselect(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) < 1 { return mlrval.FromErrorString("mapselect: received a zero-length array as input") @@ -250,7 +245,6 @@ func BIF_mapselect(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromMap(newMap) } -// ---------------------------------------------------------------- func BIF_mapexcept(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) < 1 { return mlrval.FromErrorString("mapexcept: received a zero-length array as input") @@ -281,7 +275,6 @@ func BIF_mapexcept(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromMap(newMap) } -// ---------------------------------------------------------------- func BIF_mapsum(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) == 0 { return mlrval.FromEmptyMap() @@ -307,7 +300,6 @@ func BIF_mapsum(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromMap(newMap) } -// ---------------------------------------------------------------- func BIF_mapdiff(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) == 0 { return mlrval.FromEmptyMap() @@ -619,7 +611,6 @@ func bif_splitax_helper(input string, separator string) *mlrval.Mlrval { return mlrval.FromArray(arrayval) } -// ---------------------------------------------------------------- func BIF_get_keys(input1 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsMap() { // TODO: make a ReferenceFrom with comments @@ -645,7 +636,6 @@ func BIF_get_keys(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func BIF_get_values(input1 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsMap() { mapval := input1.AcquireMapValue() @@ -670,7 +660,6 @@ func BIF_get_values(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func BIF_append(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { if !input1.IsArray() { return mlrval.FromNotArrayError("append", input1) @@ -774,7 +763,6 @@ func BIF_arrayify(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func BIF_json_parse(input1 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsVoid() { return input1 diff --git a/pkg/bifs/datetime.go b/pkg/bifs/datetime.go index 84bd48fd1..6674788d0 100644 --- a/pkg/bifs/datetime.go +++ b/pkg/bifs/datetime.go @@ -18,7 +18,6 @@ var ptr_ISO8601_TIME_FORMAT = mlrval.FromString("%Y-%m-%dT%H:%M:%SZ") var ptr_ISO8601_LOCAL_TIME_FORMAT = mlrval.FromString("%Y-%m-%d %H:%M:%S") var ptr_YMD_FORMAT = mlrval.FromString("%Y-%m-%d") -// ================================================================ func BIF_systime() *mlrval.Mlrval { return mlrval.FromFloat( float64(time.Now().UnixNano()) / 1.0e9, @@ -50,7 +49,6 @@ func BIF_upntime() *mlrval.Mlrval { ) } -// ================================================================ func BIF_sec2gmt_unary(input1 *mlrval.Mlrval) *mlrval.Mlrval { floatValue, isNumeric := input1.GetNumericToFloatValue() @@ -218,7 +216,6 @@ func BIF_nsec2localdate_binary(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return BIF_strfntime_local_ternary(input1, ptr_YMD_FORMAT, input2) } -// ---------------------------------------------------------------- func BIF_localtime2gmt_unary(input1 *mlrval.Mlrval) *mlrval.Mlrval { if !input1.IsString() { return mlrval.FromNotStringError("localtime2gmt", input1) @@ -527,7 +524,6 @@ func BIF_localtime2nsec_unary(input1 *mlrval.Mlrval) *mlrval.Mlrval { return bif_strptime_unary_aux(input1, ptr_ISO8601_LOCAL_TIME_FORMAT, true, true) } -// ---------------------------------------------------------------- func BIF_strptime_local_binary(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return bif_strptime_binary_aux(input1, input2, true, false) @@ -565,7 +561,6 @@ func bif_strptime_binary_aux(input1, input2 *mlrval.Mlrval, doLocal, produceNano } } -// ---------------------------------------------------------------- func BIF_strptime_local_ternary(input1, input2, input3 *mlrval.Mlrval) *mlrval.Mlrval { return bif_strptime_local_ternary_aux(input1, input2, input3, false) diff --git a/pkg/bifs/mathlib.go b/pkg/bifs/mathlib.go index 1c5395f69..e68030cfe 100644 --- a/pkg/bifs/mathlib.go +++ b/pkg/bifs/mathlib.go @@ -32,7 +32,6 @@ func _math_unary_void1(input1 *mlrval.Mlrval, f mathLibUnaryFunc, fname string) return mlrval.VOID } -// ---------------------------------------------------------------- func math_unary_f_i(input1 *mlrval.Mlrval, f mathLibUnaryFunc, fname string) *mlrval.Mlrval { return mlrval.FromFloat(f(float64(input1.AcquireIntValue()))) } @@ -207,7 +206,6 @@ func BIF_pow(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return pow_dispositions[input1.Type()][input2.Type()](input1, input2) } -// ================================================================ func atan2_f_ii(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromFloat(math.Atan2(float64(input1.AcquireIntValue()), float64(input2.AcquireIntValue()))) } @@ -244,7 +242,6 @@ func BIF_atan2(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return atan2_dispositions[input1.Type()][input2.Type()](input1, input2) } -// ================================================================ func mlr_roundm(x, m float64) float64 { return math.Round(x/m) * m } @@ -285,7 +282,6 @@ func BIF_roundm(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return roundm_dispositions[input1.Type()][input2.Type()](input1, input2) } -// ================================================================ func logifit_te(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromTypeErrorBinary("logifit", input1, input2) } diff --git a/pkg/bifs/percentiles.go b/pkg/bifs/percentiles.go index ef1083879..46457da8a 100644 --- a/pkg/bifs/percentiles.go +++ b/pkg/bifs/percentiles.go @@ -196,7 +196,6 @@ func GetPercentileLinearlyInterpolated( // * I like option 2 for its simplicity ... // * ... but option 1 matches R's quantile with type=1. // * (Note that Miller's interpolated percentiles match match R's quantile with type=7) -// ---------------------------------------------------------------- func GetPercentileNonInterpolated( array []*mlrval.Mlrval, diff --git a/pkg/bifs/stats.go b/pkg/bifs/stats.go index 1f955dcbc..77eef481c 100644 --- a/pkg/bifs/stats.go +++ b/pkg/bifs/stats.go @@ -24,7 +24,6 @@ import ( // // output = [m, b, math.sqrt(var_m), math.sqrt(var_b)] -// ---------------------------------------------------------------- func BIF_finalize_variance(mn, msum, msum2 *mlrval.Mlrval) *mlrval.Mlrval { n, isInt := mn.GetIntValue() lib.InternalCodingErrorIf(!isInt) @@ -46,7 +45,6 @@ func BIF_finalize_variance(mn, msum, msum2 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromFloat(numerator / denominator) } -// ---------------------------------------------------------------- func BIF_finalize_stddev(mn, msum, msum2 *mlrval.Mlrval) *mlrval.Mlrval { mvar := BIF_finalize_variance(mn, msum, msum2) if mvar.IsVoid() { @@ -55,7 +53,6 @@ func BIF_finalize_stddev(mn, msum, msum2 *mlrval.Mlrval) *mlrval.Mlrval { return BIF_sqrt(mvar) } -// ---------------------------------------------------------------- func BIF_finalize_mean_eb(mn, msum, msum2 *mlrval.Mlrval) *mlrval.Mlrval { mvar := BIF_finalize_variance(mn, msum, msum2) if mvar.IsVoid() { @@ -87,7 +84,6 @@ func BIF_finalize_mean_eb(mn, msum, msum2 *mlrval.Mlrval) *mlrval.Mlrval { // = sumx2 - 2 n mean^2 + n mean^2 // = sumx2 - n mean^2 -// ---------------------------------------------------------------- func BIF_finalize_skewness(mn, msum, msum2, msum3 *mlrval.Mlrval) *mlrval.Mlrval { n, isInt := mn.GetIntValue() lib.InternalCodingErrorIf(!isInt) @@ -124,7 +120,6 @@ func BIF_finalize_skewness(mn, msum, msum2, msum3 *mlrval.Mlrval) *mlrval.Mlrval // = sumx4 - mean*(4 sumx3 - 6 mean sumx2 + 3 n mean^3) // = sumx4 - mean*(4 sumx3 - mean*(6 sumx2 - 3 n mean^2)) -// ---------------------------------------------------------------- func BIF_finalize_kurtosis(mn, msum, msum2, msum3, msum4 *mlrval.Mlrval) *mlrval.Mlrval { n, isInt := mn.GetIntValue() lib.InternalCodingErrorIf(!isInt) diff --git a/pkg/bifs/strings.go b/pkg/bifs/strings.go index 73aef62bf..92099e590 100644 --- a/pkg/bifs/strings.go +++ b/pkg/bifs/strings.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/mlrval" ) -// ================================================================ func BIF_strlen(input1 *mlrval.Mlrval) *mlrval.Mlrval { if !input1.IsStringOrVoid() { return mlrval.FromTypeErrorUnary("strlen", input1) @@ -20,7 +19,6 @@ func BIF_strlen(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ================================================================ func BIF_string(input1 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromString(input1.String()) } @@ -168,7 +166,6 @@ func BIF_contains(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromBool(strings.Contains(input1.String(), input2.String())) } -// ================================================================ func BIF_truncate(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsErrorOrAbsent() { return input1 @@ -197,7 +194,6 @@ func BIF_truncate(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ================================================================ func BIF_leftpad(input1, input2, input3 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsErrorOrAbsent() { return input1 @@ -264,7 +260,6 @@ func BIF_rightpad(input1, input2, input3 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromString(buffer.String()) } -// ================================================================ func BIF_lstrip(input1 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsString() { return mlrval.FromString(strings.TrimLeft(input1.AcquireStringValue(), " \t")) @@ -289,7 +284,6 @@ func BIF_strip(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func BIF_collapse_whitespace(input1 *mlrval.Mlrval) *mlrval.Mlrval { return BIF_collapse_whitespace_regexp(input1, _whitespace_regexp) } @@ -304,7 +298,6 @@ func BIF_collapse_whitespace_regexp(input1 *mlrval.Mlrval, whitespaceRegexp *reg var _whitespace_regexp = regexp.MustCompile(`\s+`) -// ================================================================ func BIF_toupper(input1 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsString() { return mlrval.FromString(strings.ToUpper(input1.AcquireStringValue())) @@ -342,7 +335,6 @@ func BIF_capitalize(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func BIF_clean_whitespace(input1 *mlrval.Mlrval) *mlrval.Mlrval { mv := BIF_strip( BIF_collapse_whitespace_regexp( @@ -352,7 +344,6 @@ func BIF_clean_whitespace(input1 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromInferredType(mv.String()) } -// ================================================================ func BIF_format(mlrvals []*mlrval.Mlrval) *mlrval.Mlrval { if len(mlrvals) == 0 { return mlrval.VOID @@ -476,7 +467,6 @@ func bif_unformat_aux(input1, input2 *mlrval.Mlrval, inferTypes bool) *mlrval.Ml return output } -// ================================================================ func BIF_hexfmt(input1 *mlrval.Mlrval) *mlrval.Mlrval { if input1.IsInt() { return mlrval.FromString("0x" + strconv.FormatUint(uint64(input1.AcquireIntValue()), 16)) @@ -485,7 +475,6 @@ func BIF_hexfmt(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func fmtnum_is(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { if !input2.IsString() { return mlrval.FromTypeErrorUnary("fmtnum", input2) diff --git a/pkg/bifs/types.go b/pkg/bifs/types.go index d3e8d61ef..cbebed0ba 100644 --- a/pkg/bifs/types.go +++ b/pkg/bifs/types.go @@ -10,12 +10,10 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ================================================================ func BIF_typeof(input1 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromString(input1.GetTypeName()) } -// ---------------------------------------------------------------- func string_to_int(input1 *mlrval.Mlrval) *mlrval.Mlrval { i, ok := lib.TryIntFromString(input1.AcquireStringValue()) if ok { @@ -66,7 +64,6 @@ func BIF_int(input1 *mlrval.Mlrval) *mlrval.Mlrval { return to_int_dispositions[input1.Type()](input1) } -// ---------------------------------------------------------------- func string_to_int_with_base(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { i, ok := lib.TryIntFromStringWithBase(input1.AcquireStringValue(), input2.AcquireIntValue()) if ok { @@ -124,7 +121,6 @@ func BIF_int_with_base(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { return to_int_with_base_dispositions[input1.Type()](input1, input2) } -// ---------------------------------------------------------------- func string_to_float(input1 *mlrval.Mlrval) *mlrval.Mlrval { f, ok := lib.TryFloatFromString(input1.AcquireStringValue()) if ok { @@ -175,7 +171,6 @@ func BIF_float(input1 *mlrval.Mlrval) *mlrval.Mlrval { return to_float_dispositions[input1.Type()](input1) } -// ---------------------------------------------------------------- func string_to_boolean(input1 *mlrval.Mlrval) *mlrval.Mlrval { b, ok := lib.TryBoolFromBoolString(input1.AcquireStringValue()) if ok { @@ -222,7 +217,6 @@ func BIF_boolean(input1 *mlrval.Mlrval) *mlrval.Mlrval { return to_boolean_dispositions[input1.Type()](input1) } -// ---------------------------------------------------------------- func BIF_is_absent(input1 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromBool(input1.IsAbsent()) } @@ -311,7 +305,6 @@ func BIF_is_nan(input1 *mlrval.Mlrval) *mlrval.Mlrval { } } -// ---------------------------------------------------------------- func assertingCommon(input1, check *mlrval.Mlrval, description string, context *types.Context) *mlrval.Mlrval { if check.IsFalse() { // TODO: get context as in the C impl diff --git a/pkg/cli/flatten_unflatten.go b/pkg/cli/flatten_unflatten.go index 1675f7db5..ce5711757 100644 --- a/pkg/cli/flatten_unflatten.go +++ b/pkg/cli/flatten_unflatten.go @@ -56,7 +56,6 @@ package cli // * Overriding these: if the last verb the user has explicitly provided is // flatten, don't undo that by putting an unflatten right after. // -// ================================================================ func DecideFinalFlatten(writerOptions *TWriterOptions) bool { ofmt := writerOptions.OutputFileFormat diff --git a/pkg/cli/option_parse.go b/pkg/cli/option_parse.go index af5ef719f..f67ea62b1 100644 --- a/pkg/cli/option_parse.go +++ b/pkg/cli/option_parse.go @@ -94,7 +94,6 @@ func FinalizeWriterOptions(writerOptions *TWriterOptions) error { return nil } -// ================================================================ var FLAG_TABLE = FlagTable{ sections: []*FlagSection{ &LegacyFlagSection, diff --git a/pkg/cli/option_types.go b/pkg/cli/option_types.go index 0dd201467..e0d76f500 100644 --- a/pkg/cli/option_types.go +++ b/pkg/cli/option_types.go @@ -80,7 +80,6 @@ type TReaderOptions struct { RecordsPerBatch int64 } -// ---------------------------------------------------------------- type TWriterOptions struct { OutputFileFormat string ORS string @@ -179,7 +178,6 @@ type TWriterOptions struct { FailOnDataError bool } -// ---------------------------------------------------------------- type TOptions struct { ReaderOptions TReaderOptions WriterOptions TWriterOptions diff --git a/pkg/dsl/ast_types.go b/pkg/dsl/ast_types.go index 80fd7dcc5..3ea32c4d3 100644 --- a/pkg/dsl/ast_types.go +++ b/pkg/dsl/ast_types.go @@ -8,19 +8,16 @@ import ( "github.com/johnkerl/miller/v6/pkg/parsing/token" ) -// ---------------------------------------------------------------- type AST struct { RootNode *ASTNode } -// ---------------------------------------------------------------- type ASTNode struct { Token *token.Token // Nil for tokenless/structural nodes Type TNodeType Children []*ASTNode } -// ---------------------------------------------------------------- type TNodeType string const ( diff --git a/pkg/dsl/cst/assignments.go b/pkg/dsl/cst/assignments.go index 2bf316462..de3ff697b 100644 --- a/pkg/dsl/cst/assignments.go +++ b/pkg/dsl/cst/assignments.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ================================================================ func (root *RootNode) BuildAssignmentNode( astNode *dsl.ASTNode, ) (*AssignmentNode, error) { @@ -40,7 +39,6 @@ func (root *RootNode) BuildAssignmentNode( }, nil } -// ---------------------------------------------------------------- type AssignmentNode struct { lvalueNode IAssignable rvalueNode IEvaluable @@ -59,7 +57,6 @@ func (node *AssignmentNode) Execute( return nil, nil } -// ================================================================ func (root *RootNode) BuildUnsetNode( astNode *dsl.ASTNode, ) (*UnsetNode, error) { @@ -81,7 +78,6 @@ func (root *RootNode) BuildUnsetNode( }, nil } -// ---------------------------------------------------------------- type UnsetNode struct { lvalueNodes []IAssignable } diff --git a/pkg/dsl/cst/block_exit.go b/pkg/dsl/cst/block_exit.go index 8542e88e7..40fe4b89a 100644 --- a/pkg/dsl/cst/block_exit.go +++ b/pkg/dsl/cst/block_exit.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- type BreakNode struct { } @@ -32,7 +31,6 @@ func (node *BreakNode) Execute(state *runtime.State) (*BlockExitPayload, error) }, nil } -// ---------------------------------------------------------------- type ContinueNode struct { } @@ -51,7 +49,6 @@ func (node *ContinueNode) Execute(state *runtime.State) (*BlockExitPayload, erro }, nil } -// ---------------------------------------------------------------- type ReturnNode struct { returnValueExpression IEvaluable } diff --git a/pkg/dsl/cst/blocks.go b/pkg/dsl/cst/blocks.go index 4b47bf574..cbc69fb17 100644 --- a/pkg/dsl/cst/blocks.go +++ b/pkg/dsl/cst/blocks.go @@ -11,19 +11,16 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- func NewStatementBlockNode() *StatementBlockNode { return &StatementBlockNode{ executables: make([]IExecutable, 0), } } -// ---------------------------------------------------------------- func (node *StatementBlockNode) AppendStatementNode(executable IExecutable) { node.executables = append(node.executables, executable) } -// ---------------------------------------------------------------- func (root *RootNode) BuildStatementBlockNodeFromBeginOrEnd( astBeginOrEndNode *dsl.ASTNode, ) (*StatementBlockNode, error) { @@ -72,7 +69,6 @@ func (root *RootNode) BuildStatementBlockNodeFromBeginOrEnd( } } -// ---------------------------------------------------------------- func (root *RootNode) BuildStatementBlockNode( astNode *dsl.ASTNode, ) (*StatementBlockNode, error) { @@ -93,7 +89,6 @@ func (root *RootNode) BuildStatementBlockNode( return statementBlockNode, nil } -// ---------------------------------------------------------------- func (node *StatementBlockNode) Execute(state *runtime.State) (*BlockExitPayload, error) { state.Stack.PushStackFrame() defer state.Stack.PopStackFrame() diff --git a/pkg/dsl/cst/builtin_function_manager.go b/pkg/dsl/cst/builtin_function_manager.go index a734c6df6..b478af88e 100644 --- a/pkg/dsl/cst/builtin_function_manager.go +++ b/pkg/dsl/cst/builtin_function_manager.go @@ -41,7 +41,6 @@ const ( FUNC_CLASS_TIME TFunctionClass = "time" ) -// ================================================================ type BuiltinFunctionInfo struct { name string class TFunctionClass @@ -66,7 +65,6 @@ type BuiltinFunctionInfo struct { variadicFuncWithState VariadicFuncWithState // sort } -// ================================================================ func isLetter(c byte) bool { return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') @@ -2539,7 +2537,6 @@ Run a command via executable, path, args and environment, yielding its stdout mi return lookupTable } -// ================================================================ type BuiltinFunctionManager struct { // We need both the array and the hashmap since Go maps are not // insertion-order-preserving: to produce a sensical help-all-functions @@ -2581,7 +2578,6 @@ func hashifyLookupTable(lookupTable *[]BuiltinFunctionInfo) map[string]*BuiltinF return hashTable } -// ---------------------------------------------------------------- func (manager *BuiltinFunctionManager) ListBuiltinFunctionClasses() { classesList := manager.getBuiltinFunctionClasses() @@ -2604,7 +2600,6 @@ func (manager *BuiltinFunctionManager) getBuiltinFunctionClasses() []string { return classesList } -// ---------------------------------------------------------------- func (manager *BuiltinFunctionManager) ListBuiltinFunctionsInClass(class string) { for _, builtinFunctionInfo := range *manager.lookupTable { @@ -2639,7 +2634,6 @@ func (manager *BuiltinFunctionManager) ListBuiltinFunctionsAsTable() { } } -// ---------------------------------------------------------------- func (manager *BuiltinFunctionManager) ListBuiltinFunctionUsages() { for i, builtinFunctionInfo := range *manager.lookupTable { if i > 0 { diff --git a/pkg/dsl/cst/builtin_functions.go b/pkg/dsl/cst/builtin_functions.go index 12c16ea45..736d0a0f8 100644 --- a/pkg/dsl/cst/builtin_functions.go +++ b/pkg/dsl/cst/builtin_functions.go @@ -15,7 +15,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- func (root *RootNode) BuildBuiltinFunctionCallsiteNode( astNode *dsl.ASTNode, ) (IEvaluable, error) { @@ -63,7 +62,6 @@ func (root *RootNode) BuildBuiltinFunctionCallsiteNode( return nil, nil // not found } -// ---------------------------------------------------------------- func (root *RootNode) BuildMultipleArityFunctionCallsiteNode( astNode *dsl.ASTNode, builtinFunctionInfo *BuiltinFunctionInfo, @@ -85,7 +83,6 @@ func (root *RootNode) BuildMultipleArityFunctionCallsiteNode( ) } -// ---------------------------------------------------------------- type ZaryFunctionCallsiteNode struct { zaryFunc bifs.ZaryFunc } @@ -117,7 +114,6 @@ func (node *ZaryFunctionCallsiteNode) Evaluate( return node.zaryFunc() } -// ---------------------------------------------------------------- type UnaryFunctionCallsiteNode struct { unaryFunc bifs.UnaryFunc evaluable1 IEvaluable @@ -156,7 +152,6 @@ func (node *UnaryFunctionCallsiteNode) Evaluate( return node.unaryFunc(node.evaluable1.Evaluate(state)) } -// ---------------------------------------------------------------- type UnaryFunctionWithContextCallsiteNode struct { unaryFuncWithContext bifs.UnaryFuncWithContext evaluable1 IEvaluable @@ -195,7 +190,6 @@ func (node *UnaryFunctionWithContextCallsiteNode) Evaluate( return node.unaryFuncWithContext(node.evaluable1.Evaluate(state), state.Context) } -// ---------------------------------------------------------------- type BinaryFunctionCallsiteNode struct { binaryFunc bifs.BinaryFunc evaluable1 IEvaluable @@ -269,7 +263,6 @@ func (node *BinaryFunctionCallsiteNode) Evaluate( ) } -// ---------------------------------------------------------------- type BinaryFunctionWithStateCallsiteNode struct { binaryFuncWithState BinaryFuncWithState evaluable1 IEvaluable @@ -318,7 +311,6 @@ func (node *BinaryFunctionWithStateCallsiteNode) Evaluate( ) } -// ---------------------------------------------------------------- type TernaryFunctionWithStateCallsiteNode struct { ternaryFuncWithState TernaryFuncWithState evaluable1 IEvaluable @@ -519,7 +511,6 @@ func (node *DotCallsiteNode) Evaluate( } } -// ---------------------------------------------------------------- type TernaryFunctionCallsiteNode struct { ternaryFunc bifs.TernaryFunc evaluable1 IEvaluable @@ -583,7 +574,6 @@ func (node *TernaryFunctionCallsiteNode) Evaluate( ) } -// ---------------------------------------------------------------- type VariadicFunctionCallsiteNode struct { variadicFunc bifs.VariadicFunc evaluables []IEvaluable @@ -641,7 +631,6 @@ func (node *VariadicFunctionCallsiteNode) Evaluate( return node.variadicFunc(args) } -// ---------------------------------------------------------------- type VariadicFunctionWithStateCallsiteNode struct { variadicFuncWithState VariadicFuncWithState evaluables []IEvaluable @@ -699,7 +688,6 @@ func (node *VariadicFunctionWithStateCallsiteNode) Evaluate( return node.variadicFuncWithState(args, state) } -// ================================================================ type LogicalANDOperatorNode struct { a, b IEvaluable } @@ -799,7 +787,6 @@ func (node *LogicalANDOperatorNode) Evaluate( return bifs.BIF_logical_AND(aout, bout) } -// ================================================================ type LogicalOROperatorNode struct { a, b IEvaluable } @@ -929,7 +916,6 @@ func (node *EmptyCoalesceOperatorNode) Evaluate( } } -// ================================================================ type StandardTernaryOperatorNode struct{ a, b, c IEvaluable } func BuildStandardTernaryOperatorNode(a, b, c IEvaluable) *StandardTernaryOperatorNode { diff --git a/pkg/dsl/cst/collections.go b/pkg/dsl/cst/collections.go index 85866f7d7..e31209973 100644 --- a/pkg/dsl/cst/collections.go +++ b/pkg/dsl/cst/collections.go @@ -15,7 +15,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- type ArrayLiteralNode struct { evaluables []IEvaluable } @@ -53,7 +52,6 @@ func (node *ArrayLiteralNode) Evaluate( return mlrval.FromArray(mlrvals) } -// ---------------------------------------------------------------- type ArrayOrMapIndexAccessNode struct { baseEvaluable IEvaluable indexEvaluable IEvaluable @@ -138,7 +136,6 @@ func (node *ArrayOrMapIndexAccessNode) Evaluate( } } -// ---------------------------------------------------------------- type ArraySliceAccessNode struct { baseEvaluable IEvaluable lowerIndexEvaluable IEvaluable @@ -498,7 +495,6 @@ func NewEvaluablePair(key IEvaluable, value IEvaluable) *EvaluablePair { } } -// ---------------------------------------------------------------- type MapLiteralNode struct { evaluablePairs []*EvaluablePair } diff --git a/pkg/dsl/cst/cond.go b/pkg/dsl/cst/cond.go index 52dd30dea..e505054c5 100644 --- a/pkg/dsl/cst/cond.go +++ b/pkg/dsl/cst/cond.go @@ -46,7 +46,6 @@ func (root *RootNode) BuildCondBlockNode(astNode *dsl.ASTNode) (*CondBlockNode, return condBlockNode, nil } -// ---------------------------------------------------------------- func (node *CondBlockNode) Execute( state *runtime.State, ) (*BlockExitPayload, error) { diff --git a/pkg/dsl/cst/dump.go b/pkg/dsl/cst/dump.go index 5d79ce3f5..c71611fed 100644 --- a/pkg/dsl/cst/dump.go +++ b/pkg/dsl/cst/dump.go @@ -28,7 +28,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ================================================================ type tDumpToRedirectFunc func( outputString string, state *runtime.State, @@ -41,7 +40,6 @@ type DumpStatementNode struct { outputHandlerManager output.OutputHandlerManager // for file/pipe targets } -// ---------------------------------------------------------------- func (root *RootNode) BuildDumpStatementNode(astNode *dsl.ASTNode) (IExecutable, error) { lib.InternalCodingErrorIf(astNode.Type != dsl.NodeTypeDumpStatement) return root.buildDumpxStatementNode( @@ -151,7 +149,6 @@ func (root *RootNode) buildDumpxStatementNode( return retval, nil } -// ---------------------------------------------------------------- func (node *DumpStatementNode) Execute(state *runtime.State) (*BlockExitPayload, error) { // 5x faster than fmt.Dump() separately: note that os.Stdout is // non-buffered in Go whereas stdout is buffered in C. @@ -176,7 +173,6 @@ func (node *DumpStatementNode) Execute(state *runtime.State) (*BlockExitPayload, return nil, nil } -// ---------------------------------------------------------------- func (node *DumpStatementNode) dumpToStdout( outputString string, state *runtime.State, @@ -194,7 +190,6 @@ func (node *DumpStatementNode) dumpToStdout( return nil } -// ---------------------------------------------------------------- func (node *DumpStatementNode) dumpToStderr( outputString string, state *runtime.State, @@ -203,7 +198,6 @@ func (node *DumpStatementNode) dumpToStderr( return nil } -// ---------------------------------------------------------------- func (node *DumpStatementNode) dumpToFileOrPipe( outputString string, state *runtime.State, diff --git a/pkg/dsl/cst/emit_emitp.go b/pkg/dsl/cst/emit_emitp.go index f460080ce..12a70a1ff 100644 --- a/pkg/dsl/cst/emit_emitp.go +++ b/pkg/dsl/cst/emit_emitp.go @@ -106,7 +106,6 @@ func (root *RootNode) BuildEmitPStatementNode(astNode *dsl.ASTNode) (IExecutable return root.buildEmitXStatementNode(astNode, true) } -// ---------------------------------------------------------------- var EMITX_NAMED_NODE_TYPES = map[dsl.TNodeType]bool{ dsl.NodeTypeLocalVariable: true, @@ -285,7 +284,6 @@ func (root *RootNode) buildEmitXStatementNode( return retval, nil } -// ================================================================ func (node *EmitXStatementNode) Execute(state *runtime.State) (*BlockExitPayload, error) { if node.topLevelEvaluableMap == nil { // 'emit @a', 'emit (@a, @b)', etc. @@ -506,7 +504,6 @@ func (node *EmitXStatementNode) executeNonIndexedLashedEmitP( return node.emitToRedirectFunc(newrec, state) } -// ---------------------------------------------------------------- func (node *EmitXStatementNode) executeIndexed( names []string, values []*mlrval.Mlrval, @@ -968,7 +965,6 @@ func (node *EmitXStatementNode) executeIndexedLashedEmitPAux( return nil } -// ---------------------------------------------------------------- func (node *EmitXStatementNode) emitRecordToRecordStream( outrec *mlrval.Mlrmap, state *runtime.State, @@ -982,7 +978,6 @@ func (node *EmitXStatementNode) emitRecordToRecordStream( return nil } -// ---------------------------------------------------------------- func (node *EmitXStatementNode) emitRecordToFileOrPipe( outrec *mlrval.Mlrmap, state *runtime.State, diff --git a/pkg/dsl/cst/emitf.go b/pkg/dsl/cst/emitf.go index 22017b94b..a06020529 100644 --- a/pkg/dsl/cst/emitf.go +++ b/pkg/dsl/cst/emitf.go @@ -166,7 +166,6 @@ func getNameFromNamedNode(astNode *dsl.ASTNode, description string) (string, err return "", fmt.Errorf(`mlr: can't get name of node type "%s" for %s`, string(astNode.Type), description) } -// ---------------------------------------------------------------- func (node *EmitFStatementNode) emitfToRecordStream( outrec *mlrval.Mlrmap, state *runtime.State, @@ -180,7 +179,6 @@ func (node *EmitFStatementNode) emitfToRecordStream( return nil } -// ---------------------------------------------------------------- func (node *EmitFStatementNode) emitfToFileOrPipe( outrec *mlrval.Mlrmap, state *runtime.State, diff --git a/pkg/dsl/cst/evaluable.go b/pkg/dsl/cst/evaluable.go index ea5673be9..abe25cf61 100644 --- a/pkg/dsl/cst/evaluable.go +++ b/pkg/dsl/cst/evaluable.go @@ -16,7 +16,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- func (root *RootNode) BuildEvaluableNode(astNode *dsl.ASTNode) (IEvaluable, error) { if astNode.Children == nil { @@ -84,7 +83,6 @@ func (root *RootNode) BuildEvaluableNode(astNode *dsl.ASTNode) (IEvaluable, erro ) } -// ---------------------------------------------------------------- type IndirectFieldValueNode struct { fieldNameEvaluable IEvaluable } @@ -134,7 +132,6 @@ func (node *IndirectFieldValueNode) Evaluate( return value } -// ---------------------------------------------------------------- type IndirectOosvarValueNode struct { oosvarNameEvaluable IEvaluable } diff --git a/pkg/dsl/cst/filter.go b/pkg/dsl/cst/filter.go index dbcbb2252..e1aa5ff9d 100644 --- a/pkg/dsl/cst/filter.go +++ b/pkg/dsl/cst/filter.go @@ -34,7 +34,6 @@ type BareBooleanStatementNode struct { writeToState bool } -// ---------------------------------------------------------------- func (root *RootNode) BuildBareBooleanStatementNode(astNode *dsl.ASTNode) (IExecutable, error) { lib.InternalCodingErrorIf(astNode.Type != dsl.NodeTypeBareBoolean) lib.InternalCodingErrorIf(len(astNode.Children) != 1) diff --git a/pkg/dsl/cst/for.go b/pkg/dsl/cst/for.go index 074f3b500..e7c13ea43 100644 --- a/pkg/dsl/cst/for.go +++ b/pkg/dsl/cst/for.go @@ -32,7 +32,6 @@ import ( // * LocalVariable "k" // * LocalVariable "k" -// ================================================================ type ForLoopOneVariableNode struct { indexVariable *runtime.StackVariable indexableNode IEvaluable @@ -204,7 +203,6 @@ func (node *ForLoopOneVariableNode) Execute(state *runtime.State) (*BlockExitPay return nil, nil } -// ================================================================ type ForLoopTwoVariableNode struct { keyIndexVariable *runtime.StackVariable valueIndexVariable *runtime.StackVariable @@ -397,7 +395,6 @@ func (node *ForLoopTwoVariableNode) Execute(state *runtime.State) (*BlockExitPay return nil, nil } -// ================================================================ type ForLoopMultivariableNode struct { keyIndexVariables []*runtime.StackVariable valueIndexVariable *runtime.StackVariable @@ -519,7 +516,6 @@ func (node *ForLoopMultivariableNode) Execute(state *runtime.State) (*BlockExitP } } -// ---------------------------------------------------------------- func (node *ForLoopMultivariableNode) executeOuter( mv *mlrval.Mlrval, keyIndexVariables []*runtime.StackVariable, @@ -609,7 +605,6 @@ func (node *ForLoopMultivariableNode) executeOuter( return nil, nil } -// ---------------------------------------------------------------- func (node *ForLoopMultivariableNode) executeInner( mv *mlrval.Mlrval, keyIndexVariable *runtime.StackVariable, @@ -704,7 +699,6 @@ func (node *ForLoopMultivariableNode) executeInner( return nil, nil } -// ================================================================ type TripleForLoopNode struct { startBlockNode *StatementBlockNode precontinuationAssignments []IExecutable diff --git a/pkg/dsl/cst/if.go b/pkg/dsl/cst/if.go index b85f68119..ba264bffa 100644 --- a/pkg/dsl/cst/if.go +++ b/pkg/dsl/cst/if.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- type IfChainNode struct { ifItems []*IfItem } @@ -120,7 +119,6 @@ func (root *RootNode) BuildIfChainNode(astNode *dsl.ASTNode) (*IfChainNode, erro return ifChainNode, nil } -// ---------------------------------------------------------------- func (node *IfChainNode) Execute(state *runtime.State) (*BlockExitPayload, error) { for _, ifItem := range node.ifItems { condition := mlrval.TRUE diff --git a/pkg/dsl/cst/keyword_usage.go b/pkg/dsl/cst/keyword_usage.go index 0f5341980..2a49565e0 100644 --- a/pkg/dsl/cst/keyword_usage.go +++ b/pkg/dsl/cst/keyword_usage.go @@ -8,7 +8,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/lib" ) -// ---------------------------------------------------------------- type tKeywordUsageFunc func() type tKeywordUsageEntry struct { @@ -116,14 +115,12 @@ func TryUsageForKeywordApproximate(searchString string) bool { return foundAny } -// ---------------------------------------------------------------- func ListKeywordsVertically() { for _, entry := range KEYWORD_USAGE_TABLE { fmt.Println(entry.name) } } -// ---------------------------------------------------------------- func ListKeywordsAsParagraph() { keywords := make([]string, len(KEYWORD_USAGE_TABLE)) for i, entry := range KEYWORD_USAGE_TABLE { @@ -132,7 +129,6 @@ func ListKeywordsAsParagraph() { lib.PrintWordsAsParagraph(keywords) } -// ---------------------------------------------------------------- func allKeywordUsage() { fmt.Println( `used in "emit1", "emit", "emitp", and "unset" as a synonym for @*`, diff --git a/pkg/dsl/cst/leaves.go b/pkg/dsl/cst/leaves.go index 81612d85f..d55adf947 100644 --- a/pkg/dsl/cst/leaves.go +++ b/pkg/dsl/cst/leaves.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- func (root *RootNode) BuildLeafNode( astNode *dsl.ASTNode, ) (IEvaluable, error) { @@ -83,7 +82,6 @@ func (root *RootNode) BuildLeafNode( return nil, fmt.Errorf("at CST BuildLeafNode: unhandled AST node %s", string(astNode.Type)) } -// ---------------------------------------------------------------- type DirectFieldRvalueNode struct { fieldName string } @@ -112,7 +110,6 @@ func (node *DirectFieldRvalueNode) Evaluate( } } -// ---------------------------------------------------------------- type FullSrecRvalueNode struct { } @@ -134,7 +131,6 @@ func (node *FullSrecRvalueNode) Evaluate( } } -// ---------------------------------------------------------------- type DirectOosvarRvalueNode struct { variableName string } @@ -155,7 +151,6 @@ func (node *DirectOosvarRvalueNode) Evaluate( } } -// ---------------------------------------------------------------- type FullOosvarRvalueNode struct { } @@ -307,7 +302,6 @@ func (node *RegexCaptureReplacementNode) Evaluate( ) } -// ---------------------------------------------------------------- type IntLiteralNode struct { literal *mlrval.Mlrval } @@ -325,7 +319,6 @@ func (node *IntLiteralNode) Evaluate( return node.literal } -// ---------------------------------------------------------------- type FloatLiteralNode struct { literal *mlrval.Mlrval } @@ -343,7 +336,6 @@ func (node *FloatLiteralNode) Evaluate( return node.literal } -// ---------------------------------------------------------------- type BoolLiteralNode struct { literal *mlrval.Mlrval } @@ -359,7 +351,6 @@ func (node *BoolLiteralNode) Evaluate( return node.literal } -// ---------------------------------------------------------------- type NullLiteralNode struct { literal *mlrval.Mlrval } @@ -393,7 +384,6 @@ func (node *MlrvalLiteralNode) Evaluate( return node.literal } -// ================================================================ func (root *RootNode) BuildContextVariableNode(astNode *dsl.ASTNode) (IEvaluable, error) { lib.InternalCodingErrorIf(astNode.Token == nil) sval := string(astNode.Token.Lit) @@ -433,7 +423,6 @@ func (root *RootNode) BuildContextVariableNode(astNode *dsl.ASTNode) (IEvaluable return nil, fmt.Errorf("at CST BuildContextVariableNode: unhandled context variable %s", sval) } -// ---------------------------------------------------------------- type FILENAMENode struct { } @@ -446,7 +435,6 @@ func (node *FILENAMENode) Evaluate( return mlrval.FromString(state.Context.FILENAME) } -// ---------------------------------------------------------------- type FILENUMNode struct { } @@ -459,7 +447,6 @@ func (node *FILENUMNode) Evaluate( return mlrval.FromInt(state.Context.FILENUM) } -// ---------------------------------------------------------------- type NFNode struct { } @@ -472,7 +459,6 @@ func (node *NFNode) Evaluate( return mlrval.FromInt(state.Inrec.FieldCount) } -// ---------------------------------------------------------------- type NRNode struct { } @@ -485,7 +471,6 @@ func (node *NRNode) Evaluate( return mlrval.FromInt(state.Context.NR) } -// ---------------------------------------------------------------- type FNRNode struct { } @@ -498,7 +483,6 @@ func (node *FNRNode) Evaluate( return mlrval.FromInt(state.Context.FNR) } -// ---------------------------------------------------------------- type IRSNode struct { } @@ -511,7 +495,6 @@ func (node *IRSNode) Evaluate( return mlrval.FromString(state.Options.ReaderOptions.IRS) } -// ---------------------------------------------------------------- type IFSNode struct { } @@ -524,7 +507,6 @@ func (node *IFSNode) Evaluate( return mlrval.FromString(state.Options.ReaderOptions.IFS) } -// ---------------------------------------------------------------- type IPSNode struct { } @@ -537,7 +519,6 @@ func (node *IPSNode) Evaluate( return mlrval.FromString(state.Options.ReaderOptions.IPS) } -// ---------------------------------------------------------------- type ORSNode struct { } @@ -550,7 +531,6 @@ func (node *ORSNode) Evaluate( return mlrval.FromString(state.Options.WriterOptions.ORS) } -// ---------------------------------------------------------------- type OFSNode struct { } @@ -563,7 +543,6 @@ func (node *OFSNode) Evaluate( return mlrval.FromString(state.Options.WriterOptions.OFS) } -// ---------------------------------------------------------------- type OPSNode struct { } @@ -576,7 +555,6 @@ func (node *OPSNode) Evaluate( return mlrval.FromString(state.Options.WriterOptions.OPS) } -// ---------------------------------------------------------------- type FLATSEPNode struct { } @@ -589,7 +567,6 @@ func (node *FLATSEPNode) Evaluate( return mlrval.FromString(state.Options.WriterOptions.FLATSEP) } -// ================================================================ func (root *RootNode) BuildConstantNode(astNode *dsl.ASTNode) (IEvaluable, error) { lib.InternalCodingErrorIf(astNode.Token == nil) sval := string(astNode.Token.Lit) @@ -606,7 +583,6 @@ func (root *RootNode) BuildConstantNode(astNode *dsl.ASTNode) (IEvaluable, error return nil, fmt.Errorf("at CST BuildContextVariableNode: unhandled context variable %s", sval) } -// ---------------------------------------------------------------- type MathPINode struct { } @@ -619,7 +595,6 @@ func (node *MathPINode) Evaluate( return mlrval.FromFloat(math.Pi) } -// ---------------------------------------------------------------- type MathENode struct { } @@ -632,7 +607,6 @@ func (node *MathENode) Evaluate( return mlrval.FromFloat(math.E) } -// ================================================================ type LiteralOneNode struct { } @@ -650,7 +624,6 @@ func (node *LiteralOneNode) Evaluate( return mlrval.FromInt(1) } -// ================================================================ type LiteralEmptyStringNode struct { } diff --git a/pkg/dsl/cst/lvalues.go b/pkg/dsl/cst/lvalues.go index f469c22dd..ac2631884 100644 --- a/pkg/dsl/cst/lvalues.go +++ b/pkg/dsl/cst/lvalues.go @@ -16,7 +16,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ---------------------------------------------------------------- func (root *RootNode) BuildAssignableNode( astNode *dsl.ASTNode, ) (IAssignable, error) { @@ -68,7 +67,6 @@ func (root *RootNode) BuildAssignableNode( ) } -// ---------------------------------------------------------------- type DirectFieldValueLvalueNode struct { lhsFieldName *mlrval.Mlrval } @@ -157,7 +155,6 @@ func (node *DirectFieldValueLvalueNode) UnassignIndexed( } } -// ---------------------------------------------------------------- type IndirectFieldValueLvalueNode struct { lhsFieldNameExpression IEvaluable } @@ -485,7 +482,6 @@ func (node *PositionalFieldValueLvalueNode) UnassignIndexed( } } -// ---------------------------------------------------------------- type FullSrecLvalueNode struct { } @@ -559,7 +555,6 @@ func (node *FullSrecLvalueNode) UnassignIndexed( } } -// ---------------------------------------------------------------- type DirectOosvarValueLvalueNode struct { lhsOosvarName *mlrval.Mlrval } @@ -625,7 +620,6 @@ func (node *DirectOosvarValueLvalueNode) UnassignIndexed( } } -// ---------------------------------------------------------------- type IndirectOosvarValueLvalueNode struct { lhsOosvarNameExpression IEvaluable } @@ -707,7 +701,6 @@ func (node *IndirectOosvarValueLvalueNode) UnassignIndexed( } } -// ---------------------------------------------------------------- type FullOosvarLvalueNode struct { } @@ -763,7 +756,6 @@ func (node *FullOosvarLvalueNode) UnassignIndexed( } } -// ---------------------------------------------------------------- type LocalVariableLvalueNode struct { stackVariable *runtime.StackVariable typeName string @@ -874,7 +866,6 @@ func (node *LocalVariableLvalueNode) UnassignIndexed( // o error if ith mlrval is string and that level isn't a map // o error for any other types -- maybe absent-handling for heterogeneity ... -// ---------------------------------------------------------------- type IndexedLvalueNode struct { baseLvalue IAssignable indexEvaluables []IEvaluable @@ -998,7 +989,6 @@ func (node *IndexedLvalueNode) UnassignIndexed( lib.InternalCodingErrorIf(true) } -// ---------------------------------------------------------------- type EnvironmentVariableLvalueNode struct { nameExpression IEvaluable } diff --git a/pkg/dsl/cst/print.go b/pkg/dsl/cst/print.go index 7fac5cc0c..bc62f0798 100644 --- a/pkg/dsl/cst/print.go +++ b/pkg/dsl/cst/print.go @@ -148,7 +148,6 @@ import ( // redirectorTargetEvaluable = non-nil // outputHandlerManager = non-nil -// ================================================================ type tPrintToRedirectFunc func( outputString string, state *runtime.State, @@ -162,7 +161,6 @@ type PrintStatementNode struct { outputHandlerManager output.OutputHandlerManager // for file/pipe targets } -// ---------------------------------------------------------------- func (root *RootNode) BuildPrintStatementNode(astNode *dsl.ASTNode) (IExecutable, error) { lib.InternalCodingErrorIf(astNode.Type != dsl.NodeTypePrintStatement) return root.buildPrintxStatementNode( @@ -294,7 +292,6 @@ func (root *RootNode) buildPrintxStatementNode( return retval, nil } -// ---------------------------------------------------------------- func (node *PrintStatementNode) Execute(state *runtime.State) (*BlockExitPayload, error) { if len(node.expressionEvaluables) == 0 { node.printToRedirectFunc(node.terminator, state) @@ -322,7 +319,6 @@ func (node *PrintStatementNode) Execute(state *runtime.State) (*BlockExitPayload return nil, nil } -// ---------------------------------------------------------------- func (node *PrintStatementNode) printToStdout( outputString string, state *runtime.State, @@ -340,7 +336,6 @@ func (node *PrintStatementNode) printToStdout( return nil } -// ---------------------------------------------------------------- func (node *PrintStatementNode) printToStderr( outputString string, state *runtime.State, @@ -349,7 +344,6 @@ func (node *PrintStatementNode) printToStderr( return nil } -// ---------------------------------------------------------------- func (node *PrintStatementNode) printToFileOrPipe( outputString string, state *runtime.State, diff --git a/pkg/dsl/cst/signature.go b/pkg/dsl/cst/signature.go index 210ac4a4e..26aac975c 100644 --- a/pkg/dsl/cst/signature.go +++ b/pkg/dsl/cst/signature.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type Signature struct { funcOrSubrName string arity int // Computable from len(typeGatedParameterNames) at callee, not at caller diff --git a/pkg/dsl/cst/statements.go b/pkg/dsl/cst/statements.go index 8e8edba72..eb1853513 100644 --- a/pkg/dsl/cst/statements.go +++ b/pkg/dsl/cst/statements.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/dsl" ) -// ---------------------------------------------------------------- func (root *RootNode) BuildStatementNode( astNode *dsl.ASTNode, ) (IExecutable, error) { diff --git a/pkg/dsl/cst/tee.go b/pkg/dsl/cst/tee.go index c0ef376f1..7abcf4a04 100644 --- a/pkg/dsl/cst/tee.go +++ b/pkg/dsl/cst/tee.go @@ -56,7 +56,6 @@ import ( // * string literal "jq ." // ---------------------------------------------------------------- -// ================================================================ type tTeeToRedirectFunc func( outrec *mlrval.Mlrmap, state *runtime.State, @@ -69,7 +68,6 @@ type TeeStatementNode struct { outputHandlerManager output.OutputHandlerManager // for file/pipe targets } -// ---------------------------------------------------------------- func (root *RootNode) BuildTeeStatementNode(astNode *dsl.ASTNode) (IExecutable, error) { lib.InternalCodingErrorIf(astNode.Type != dsl.NodeTypeTeeStatement) lib.InternalCodingErrorIf(len(astNode.Children) != 2) @@ -134,7 +132,6 @@ func (root *RootNode) BuildTeeStatementNode(astNode *dsl.ASTNode) (IExecutable, return retval, nil } -// ---------------------------------------------------------------- func (node *TeeStatementNode) Execute(state *runtime.State) (*BlockExitPayload, error) { expression := node.expressionEvaluable.Evaluate(state) if !expression.IsMap() { @@ -144,7 +141,6 @@ func (node *TeeStatementNode) Execute(state *runtime.State) (*BlockExitPayload, return nil, err } -// ---------------------------------------------------------------- func (node *TeeStatementNode) teeToFileOrPipe( outrec *mlrval.Mlrmap, state *runtime.State, diff --git a/pkg/dsl/cst/udf.go b/pkg/dsl/cst/udf.go index f3550669e..ce6d65c71 100644 --- a/pkg/dsl/cst/udf.go +++ b/pkg/dsl/cst/udf.go @@ -15,7 +15,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type UDF struct { signature *Signature functionBody *StatementBlockNode @@ -47,7 +46,6 @@ func NewUnresolvedUDF( return udf } -// ---------------------------------------------------------------- type UDFCallsite struct { argumentNodes []IEvaluable @@ -427,7 +425,6 @@ func (root *RootNode) BuildAndInstallUDF(astNode *dsl.ASTNode) error { return nil } -// ================================================================ var namelessFunctionCounter int = 0 diff --git a/pkg/dsl/cst/uds.go b/pkg/dsl/cst/uds.go index f42d5fc20..fcbcc08a0 100644 --- a/pkg/dsl/cst/uds.go +++ b/pkg/dsl/cst/uds.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type UDS struct { signature *Signature subroutineBody *StatementBlockNode @@ -41,7 +40,6 @@ func NewUnresolvedUDS( return uds } -// ---------------------------------------------------------------- type UDSCallsite struct { argumentNodes []IEvaluable uds *UDS @@ -158,7 +156,6 @@ func (site *UDSCallsite) Execute(state *runtime.State) (*BlockExitPayload, error return blockExitPayload, nil } -// ---------------------------------------------------------------- type UDSManager struct { subroutines map[string]*UDS } diff --git a/pkg/dsl/cst/validate.go b/pkg/dsl/cst/validate.go index 8783c6003..dc5c7e04a 100644 --- a/pkg/dsl/cst/validate.go +++ b/pkg/dsl/cst/validate.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/lib" ) -// ---------------------------------------------------------------- func ValidateAST( ast *dsl.AST, dslInstanceType DSLInstanceType, // mlr put, mlr filter, mlr repl @@ -56,7 +55,6 @@ func ValidateAST( return nil } -// ---------------------------------------------------------------- func validateASTAux( astNode *dsl.ASTNode, dslInstanceType DSLInstanceType, // mlr put, mlr filter, mlr repl @@ -302,7 +300,6 @@ func validateForLoopMultivariableUniqueNames(astNode *dsl.ASTNode) error { return nil } -// ================================================================ var VALID_LHS_NODE_TYPES = map[dsl.TNodeType]bool{ dsl.NodeTypeArrayOrMapIndexAccess: true, diff --git a/pkg/dsl/cst/while.go b/pkg/dsl/cst/while.go index ccdde0052..536aa0490 100644 --- a/pkg/dsl/cst/while.go +++ b/pkg/dsl/cst/while.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/runtime" ) -// ================================================================ type WhileLoopNode struct { conditionNode IEvaluable conditionToken *token.Token @@ -53,7 +52,6 @@ func (root *RootNode) BuildWhileLoopNode(astNode *dsl.ASTNode) (*WhileLoopNode, ), nil } -// ---------------------------------------------------------------- func (node *WhileLoopNode) Execute(state *runtime.State) (*BlockExitPayload, error) { for { condition := node.conditionNode.Evaluate(state) @@ -90,7 +88,6 @@ func (node *WhileLoopNode) Execute(state *runtime.State) (*BlockExitPayload, err return nil, nil } -// ================================================================ type DoWhileLoopNode struct { statementBlockNode *StatementBlockNode conditionNode IEvaluable @@ -130,7 +127,6 @@ func (root *RootNode) BuildDoWhileLoopNode(astNode *dsl.ASTNode) (*DoWhileLoopNo ), nil } -// ---------------------------------------------------------------- func (node *DoWhileLoopNode) Execute(state *runtime.State) (*BlockExitPayload, error) { for { blockExitPayload, err := node.statementBlockNode.Execute(state) diff --git a/pkg/input/record_reader_csv.go b/pkg/input/record_reader_csv.go index 57759ea8d..a389665ed 100644 --- a/pkg/input/record_reader_csv.go +++ b/pkg/input/record_reader_csv.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type RecordReaderCSV struct { readerOptions *cli.TReaderOptions recordsPerBatch int64 // distinct from readerOptions.RecordsPerBatch for join/repl diff --git a/pkg/lib/ordered_map.go b/pkg/lib/ordered_map.go index 5f8db0b38..d03dc6c12 100644 --- a/pkg/lib/ordered_map.go +++ b/pkg/lib/ordered_map.go @@ -7,7 +7,6 @@ package lib -// ---------------------------------------------------------------- type OrderedMap[V any] struct { FieldCount int64 Head *orderedMapEntry[V] @@ -22,7 +21,6 @@ type orderedMapEntry[V any] struct { Next *orderedMapEntry[V] } -// ---------------------------------------------------------------- func NewOrderedMap[V any]() *OrderedMap[V] { return &OrderedMap[V]{ FieldCount: 0, @@ -44,7 +42,6 @@ func newOrderedMapEntry[V any](key *string, value V) *orderedMapEntry[V] { } } -// ---------------------------------------------------------------- func (omap *OrderedMap[V]) IsEmpty() bool { return omap.FieldCount == 0 } @@ -66,7 +63,6 @@ func (omap *OrderedMap[V]) findEntry(key *string) *orderedMapEntry[V] { } } -// ---------------------------------------------------------------- func (omap *OrderedMap[V]) Put(key string, value V) { pe := omap.findEntry(&key) if pe == nil { @@ -89,7 +85,6 @@ func (omap *OrderedMap[V]) Put(key string, value V) { } } -// ---------------------------------------------------------------- func (omap *OrderedMap[V]) Get(key string) V { pe := omap.findEntry(&key) if pe == nil { @@ -123,7 +118,6 @@ func (omap *OrderedMap[V]) Remove(key string) bool { } } -// ---------------------------------------------------------------- func (omap *OrderedMap[V]) unlink(pe *orderedMapEntry[V]) { if pe == omap.Head { if pe == omap.Tail { diff --git a/pkg/lib/regex_test.go b/pkg/lib/regex_test.go index d2a8f5f70..23ec95bf1 100644 --- a/pkg/lib/regex_test.go +++ b/pkg/lib/regex_test.go @@ -9,7 +9,6 @@ import ( "testing" ) -// ---------------------------------------------------------------- type tDataForHasCaptures struct { replacement string expectedHasCaptures bool @@ -30,7 +29,6 @@ type tDataForMatches struct { expectedCaptures []string } -// ---------------------------------------------------------------- var dataForHasCaptures = []tDataForHasCaptures{ {"foo", false, nil}, {"\\0", true, [][]int{{0, 2, 0, 2}}}, diff --git a/pkg/lib/stats.go b/pkg/lib/stats.go index 84ef98bbc..1418f7533 100644 --- a/pkg/lib/stats.go +++ b/pkg/lib/stats.go @@ -53,7 +53,6 @@ import ( // b = ---------------------------------------- // D // -// ---------------------------------------------------------------- func GetLinearRegressionOLS( nint int64, @@ -174,7 +173,6 @@ func GetCov( return numerator / denominator } -// ---------------------------------------------------------------- func GetCovMatrix( nint int64, sumx float64, diff --git a/pkg/lib/time_test.go b/pkg/lib/time_test.go index f2f2c6690..587a09c7a 100644 --- a/pkg/lib/time_test.go +++ b/pkg/lib/time_test.go @@ -12,7 +12,6 @@ import ( "testing" ) -// ---------------------------------------------------------------- type tDataForSec2GMT struct { epochSeconds float64 numDecimalPlaces int @@ -32,7 +31,6 @@ func TestSec2GMT(t *testing.T) { } } -// ---------------------------------------------------------------- type tDataForNsec2GMT struct { epochNanoseconds int64 numDecimalPlaces int @@ -61,7 +59,6 @@ func TestNsec2GMT(t *testing.T) { } } -// ---------------------------------------------------------------- type tDataForEpochSecondsToGMT struct { epochSeconds float64 expectedOutput time.Time @@ -79,7 +76,6 @@ func TestEpochSecondsToGMT(t *testing.T) { } } -// ---------------------------------------------------------------- type tDataForEpochNanosecondsToGMT struct { epochNanoseconds int64 expectedOutput time.Time diff --git a/pkg/mlrval/mlrmap.go b/pkg/mlrval/mlrmap.go index 562a91def..b10f30fd8 100644 --- a/pkg/mlrval/mlrmap.go +++ b/pkg/mlrval/mlrmap.go @@ -67,7 +67,6 @@ func HashRecords(onOff bool) { hashRecords = onOff } -// ---------------------------------------------------------------- type Mlrmap struct { FieldCount int64 Head *MlrmapEntry @@ -97,7 +96,6 @@ type MlrmapPair struct { Value *Mlrval } -// ---------------------------------------------------------------- func NewMlrmapAsRecord() *Mlrmap { if hashRecords { return newMlrmapHashed() diff --git a/pkg/mlrval/mlrmap_accessors.go b/pkg/mlrval/mlrmap_accessors.go index 053e6ebb5..04cb59373 100644 --- a/pkg/mlrval/mlrmap_accessors.go +++ b/pkg/mlrval/mlrmap_accessors.go @@ -251,7 +251,6 @@ func (mlrmap *Mlrmap) PutCopyWithMlrvalIndex(key *Mlrval, value *Mlrval) error { } } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) PrependCopy(key string, value *Mlrval) { mlrmap.PrependReference(key, value.Copy()) } @@ -423,7 +422,6 @@ func (mlrmap *Mlrmap) RemoveWithPositionalIndex(position int64) { } } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) Equals(other *Mlrmap) bool { if mlrmap.FieldCount != other.FieldCount { return false @@ -465,7 +463,6 @@ func (mlrmap *Mlrmap) Clear() { } } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) Copy() *Mlrmap { other := NewMlrmapMaybeHashed(mlrmap.isHashed()) for pe := mlrmap.Head; pe != nil; pe = pe.Next { @@ -518,7 +515,6 @@ func (mlrmap *Mlrmap) RemoveIndexed(indices []*Mlrval) error { return removeIndexedOnMap(mlrmap, indices) } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) GetKeysJoined() string { var buffer bytes.Buffer i := 0 @@ -699,7 +695,6 @@ func (mlrmap *Mlrmap) GetValuesJoinedExcept(px *MlrmapEntry) string { return buffer.String() } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) Rename(oldKey string, newKey string) bool { entry := mlrmap.findEntry(oldKey) if entry == nil { @@ -729,7 +724,6 @@ func (mlrmap *Mlrmap) Rename(oldKey string, newKey string) bool { return true } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) Label(newNames []string) { other := NewMlrmapAsRecord() @@ -768,7 +762,6 @@ func (mlrmap *Mlrmap) Label(newNames []string) { *mlrmap = *other } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) SortByKey() { keys := mlrmap.GetKeys() @@ -784,7 +777,6 @@ func (mlrmap *Mlrmap) SortByKey() { *mlrmap = *other } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) SortByKeyRecursively() { keys := mlrmap.GetKeys() @@ -881,7 +873,6 @@ func (mlrmap *Mlrmap) linkAtTail(pe *MlrmapEntry) { mlrmap.FieldCount++ } -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) pop() *MlrmapEntry { if mlrmap.Head == nil { return nil diff --git a/pkg/mlrval/mlrmap_json.go b/pkg/mlrval/mlrmap_json.go index 2db38dd9d..5cd2c7422 100644 --- a/pkg/mlrval/mlrmap_json.go +++ b/pkg/mlrval/mlrmap_json.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/lib" ) -// ---------------------------------------------------------------- func (mlrmap *Mlrmap) MarshalJSON( jsonFormatting TJSONFormatting, outputIsStdout bool, diff --git a/pkg/mlrval/mlrval_collections.go b/pkg/mlrval/mlrval_collections.go index 539069c6f..e549e9ffb 100644 --- a/pkg/mlrval/mlrval_collections.go +++ b/pkg/mlrval/mlrval_collections.go @@ -93,7 +93,6 @@ func (mv *Mlrval) ArrayGet(mindex *Mlrval) Mlrval { } } -// ---------------------------------------------------------------- func arrayGetAliased(array *[]*Mlrval, mindex int) *Mlrval { zindex, ok := UnaliasArrayIndex(array, mindex) if ok { @@ -173,7 +172,6 @@ func (mv *Mlrval) ArrayAppend(value *Mlrval) { } -// ================================================================ func (mv *Mlrval) MapGet(key *Mlrval) Mlrval { if !mv.IsMap() { return *FromNotMapError("map[]", mv) @@ -191,7 +189,6 @@ func (mv *Mlrval) MapGet(key *Mlrval) Mlrval { return *mval } -// ---------------------------------------------------------------- func (mv *Mlrval) MapPut(key *Mlrval, value *Mlrval) { if !mv.IsMap() { // TODO: need to be careful about semantics here. @@ -396,7 +393,6 @@ func putIndexedOnArray( } } -// ---------------------------------------------------------------- func (mv *Mlrval) RemoveIndexed(indices []*Mlrval) error { lib.InternalCodingErrorIf(len(indices) < 1) diff --git a/pkg/mlrval/mlrval_format.go b/pkg/mlrval/mlrval_format.go index 661cad153..940b8864e 100644 --- a/pkg/mlrval/mlrval_format.go +++ b/pkg/mlrval/mlrval_format.go @@ -146,7 +146,6 @@ func newFormatter( return newFormatterToString(goFormatString), nil } -// ---------------------------------------------------------------- type formatterToFloat struct { goFormatString string @@ -176,7 +175,6 @@ func (formatter *formatterToFloat) FormatFloat(floatValue float64) string { return fmt.Sprintf(formatter.goFormatString, floatValue) } -// ---------------------------------------------------------------- func getLanguageTag() language.Tag { v, ok := os.LookupEnv("LANG") @@ -187,7 +185,6 @@ func getLanguageTag() language.Tag { } } -// ---------------------------------------------------------------- type formatterToSeparatedInt struct { goFormatString string @@ -219,7 +216,6 @@ func (formatter *formatterToSeparatedInt) FormatFloat(floatValue float64) string return formatter.printer.Sprintf(formatter.goFormatString, int(floatValue)) } -// ---------------------------------------------------------------- type formatterToSeparatedFloat struct { goFormatString string @@ -251,7 +247,6 @@ func (formatter *formatterToSeparatedFloat) FormatFloat(floatValue float64) stri return formatter.printer.Sprintf(formatter.goFormatString, floatValue) } -// ---------------------------------------------------------------- type formatterToInt struct { goFormatString string @@ -281,7 +276,6 @@ func (formatter *formatterToInt) FormatFloat(floatValue float64) string { return fmt.Sprintf(formatter.goFormatString, int(floatValue)) } -// ---------------------------------------------------------------- type formatterToString struct { goFormatString string diff --git a/pkg/mlrval/mlrval_infer.go b/pkg/mlrval/mlrval_infer.go index 187f245fd..ca35b85b8 100644 --- a/pkg/mlrval/mlrval_infer.go +++ b/pkg/mlrval/mlrval_infer.go @@ -44,8 +44,6 @@ func SetInferrerStringOnly() { packageLevelInferrer = inferString } -// ---------------------------------------------------------------- - func inferNormally(mv *Mlrval) *Mlrval { scanType := scan.FindScanType(mv.printrep) return normalInferrerTable[scanType](mv) diff --git a/pkg/mlrval/mlrval_json.go b/pkg/mlrval/mlrval_json.go index 98f5dad3b..9a3c243d1 100644 --- a/pkg/mlrval/mlrval_json.go +++ b/pkg/mlrval/mlrval_json.go @@ -101,9 +101,7 @@ var prematureEofError error = errors.New("mlr: JSON parser: unexpected premature // // This is so the Miller JSON record-reader can be streaming, not needing to // ingest all records at once, and operable within a tail -f context. -// ================================================================ -// ---------------------------------------------------------------- func (mv *Mlrval) UnmarshalJSON(inputBytes []byte) error { *mv = *FromPending() decoder := json.NewDecoder(bytes.NewReader(inputBytes)) @@ -118,7 +116,6 @@ func (mv *Mlrval) UnmarshalJSON(inputBytes []byte) error { return nil } -// ---------------------------------------------------------------- func TryUnmarshalJSON(inputBytes []byte) (pmv *Mlrval, err error) { decoder := json.NewDecoder(bytes.NewReader(inputBytes)) pmv, eof, err := MlrvalDecodeFromJSON(decoder) @@ -128,7 +125,6 @@ func TryUnmarshalJSON(inputBytes []byte) (pmv *Mlrval, err error) { return pmv, err } -// ---------------------------------------------------------------- func MlrvalDecodeFromJSON(decoder *json.Decoder) ( mlrval *Mlrval, eof bool, @@ -267,7 +263,6 @@ func MlrvalDecodeFromJSON(decoder *json.Decoder) ( } } -// ================================================================ func (mv *Mlrval) MarshalJSON( jsonFormatting TJSONFormatting, outputIsStdout bool, @@ -312,7 +307,6 @@ func (mv *Mlrval) marshalJSONAux( // ================================================================ // TYPE-SPECIFIC MARSHALERS -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONPending(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_PENDING) return "", fmt.Errorf( @@ -320,13 +314,11 @@ func (mv *Mlrval) marshalJSONPending(outputIsStdout bool) (string, error) { ) } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONError(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_ERROR) return colorizer.MaybeColorizeValue(mv.printrep, outputIsStdout), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONAbsent(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_ABSENT) return "", fmt.Errorf( @@ -334,19 +326,16 @@ func (mv *Mlrval) marshalJSONAbsent(outputIsStdout bool) (string, error) { ) } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONNull(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_NULL) return colorizer.MaybeColorizeValue("null", outputIsStdout), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONVoid(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_VOID) return colorizer.MaybeColorizeValue("\"\"", outputIsStdout), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONString(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_STRING) @@ -404,7 +393,6 @@ func millerJSONEncodeString(input string) string { return buffer.String() } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONInt(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_INT) // Other formats would use mv.String(): for example, if the user used hex @@ -419,19 +407,16 @@ func (mv *Mlrval) marshalJSONInt(outputIsStdout bool) (string, error) { return colorizer.MaybeColorizeValue(s, outputIsStdout), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONFloat(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_FLOAT) return colorizer.MaybeColorizeValue(mv.String(), outputIsStdout), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONBool(outputIsStdout bool) (string, error) { lib.InternalCodingErrorIf(mv.mvtype != MT_BOOL) return colorizer.MaybeColorizeValue(mv.String(), outputIsStdout), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONArray( jsonFormatting TJSONFormatting, elementNestingDepth int, @@ -534,7 +519,6 @@ func (mv *Mlrval) marshalJSONArrayMultipleLines( return buffer.String(), nil } -// ---------------------------------------------------------------- func (mv *Mlrval) marshalJSONMap( jsonFormatting TJSONFormatting, elementNestingDepth int, diff --git a/pkg/output/file_output_handlers.go b/pkg/output/file_output_handlers.go index cce7bfde0..0ab378f9f 100644 --- a/pkg/output/file_output_handlers.go +++ b/pkg/output/file_output_handlers.go @@ -24,7 +24,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ================================================================ type OutputHandlerManager interface { // For print-variants and dump-variants @@ -42,7 +41,6 @@ type OutputHandler interface { Close() error } -// ================================================================ type MultiOutputHandlerManager struct { outputHandlers map[string]OutputHandler @@ -55,7 +53,6 @@ type MultiOutputHandlerManager struct { recordWriterOptions *cli.TWriterOptions } -// ---------------------------------------------------------------- func NewFileOutputHandlerManager( recordWriterOptions *cli.TWriterOptions, doAppend bool, @@ -127,7 +124,6 @@ func NewStderrWriteHandlerManager( } } -// ---------------------------------------------------------------- func (manager *MultiOutputHandlerManager) WriteString( outputString string, filename string, @@ -202,7 +198,6 @@ func (manager *MultiOutputHandlerManager) Close() []error { return errs } -// ================================================================ type FileOutputHandler struct { filename string handle io.WriteCloser @@ -240,7 +235,6 @@ func newOutputHandlerCommon( } } -// ---------------------------------------------------------------- func NewFileOutputHandler( filename string, recordWriterOptions *cli.TWriterOptions, @@ -332,13 +326,11 @@ func newStderrOutputHandler( ) } -// ---------------------------------------------------------------- func (handler *FileOutputHandler) WriteString(outputString string) error { _, err := handler.bufferedOutputStream.WriteString(outputString) return err } -// ---------------------------------------------------------------- func (handler *FileOutputHandler) WriteRecordAndContext( outrecAndContext *types.RecordAndContext, ) error { @@ -383,7 +375,6 @@ func (handler *FileOutputHandler) setUpRecordWriter() error { return nil } -// ---------------------------------------------------------------- func (handler *FileOutputHandler) Close() (retval error) { retval = nil diff --git a/pkg/output/record_writer_json_jsonl.go b/pkg/output/record_writer_json_jsonl.go index 8c43d43ff..c77e88df8 100644 --- a/pkg/output/record_writer_json_jsonl.go +++ b/pkg/output/record_writer_json_jsonl.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type RecordWriterJSON struct { // Parameters: writerOptions *cli.TWriterOptions @@ -21,7 +20,6 @@ type RecordWriterJSON struct { wroteAnyRecords bool } -// ---------------------------------------------------------------- func NewRecordWriterJSON(writerOptions *cli.TWriterOptions) (*RecordWriterJSON, error) { var jsonFormatting mlrval.TJSONFormatting = mlrval.JSON_SINGLE_LINE if writerOptions.JSONOutputMultiline { @@ -35,7 +33,6 @@ func NewRecordWriterJSON(writerOptions *cli.TWriterOptions) (*RecordWriterJSON, }, nil } -// ---------------------------------------------------------------- func NewRecordWriterJSONLines(writerOptions *cli.TWriterOptions) (*RecordWriterJSON, error) { wopt := *writerOptions wopt.WrapJSONOutputInOuterList = false @@ -48,7 +45,6 @@ func NewRecordWriterJSONLines(writerOptions *cli.TWriterOptions) (*RecordWriterJ }, nil } -// ---------------------------------------------------------------- func (writer *RecordWriterJSON) Write( outrec *mlrval.Mlrmap, context *types.Context, @@ -67,7 +63,6 @@ func (writer *RecordWriterJSON) Write( return nil } -// ---------------------------------------------------------------- func (writer *RecordWriterJSON) writeWithListWrap( outrec *mlrval.Mlrmap, context *types.Context, @@ -109,7 +104,6 @@ func (writer *RecordWriterJSON) writeWithListWrap( } } -// ---------------------------------------------------------------- func (writer *RecordWriterJSON) writeWithoutListWrap( outrec *mlrval.Mlrmap, _ *types.Context, diff --git a/pkg/output/record_writer_markdown.go b/pkg/output/record_writer_markdown.go index b3b96089a..97a84dc4d 100644 --- a/pkg/output/record_writer_markdown.go +++ b/pkg/output/record_writer_markdown.go @@ -26,7 +26,6 @@ func NewRecordWriterMarkdown(writerOptions *cli.TWriterOptions) (*RecordWriterMa }, nil } -// ---------------------------------------------------------------- func (writer *RecordWriterMarkdown) Write( outrec *mlrval.Mlrmap, _ *types.Context, diff --git a/pkg/output/record_writer_pprint.go b/pkg/output/record_writer_pprint.go index bd552eb8a..31bf56581 100644 --- a/pkg/output/record_writer_pprint.go +++ b/pkg/output/record_writer_pprint.go @@ -32,7 +32,6 @@ func NewRecordWriterPPRINT(writerOptions *cli.TWriterOptions) (*RecordWriterPPRI }, nil } -// ---------------------------------------------------------------- func (writer *RecordWriterPPRINT) Write( outrec *mlrval.Mlrmap, _ *types.Context, diff --git a/pkg/output/record_writer_xtab.go b/pkg/output/record_writer_xtab.go index 5d1b52fa0..10e565f2b 100644 --- a/pkg/output/record_writer_xtab.go +++ b/pkg/output/record_writer_xtab.go @@ -25,7 +25,6 @@ import ( // def: 4567 // // then they can do that. -// ---------------------------------------------------------------- type RecordWriterXTAB struct { writerOptions *cli.TWriterOptions diff --git a/pkg/platform/getargs_windows.go b/pkg/platform/getargs_windows.go index 7a2f1af3d..75efe3331 100644 --- a/pkg/platform/getargs_windows.go +++ b/pkg/platform/getargs_windows.go @@ -93,7 +93,6 @@ func GetArgs() []string { return globbed } -// ---------------------------------------------------------------- func printArgs(args []string, description string) { fmt.Printf("%s:\n", description) for i, arg := range args { @@ -102,7 +101,6 @@ func printArgs(args []string, description string) { fmt.Println() } -// ---------------------------------------------------------------- func regroupForSingleQuote(inargs []string) ([]string, bool) { outargs := make([]string, 0, len(inargs)) inside := false diff --git a/pkg/terminals/help/entry.go b/pkg/terminals/help/entry.go index 49e5a9cd7..7d7b04961 100644 --- a/pkg/terminals/help/entry.go +++ b/pkg/terminals/help/entry.go @@ -20,7 +20,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/transformers" ) -// ================================================================ type tZaryHandlerFunc func() type tVarArgHandlerFunc func(args []string) @@ -247,7 +246,6 @@ func HelpMain(args []string) int { return 0 } -// ---------------------------------------------------------------- func MainUsage(o *os.File) { fmt.Fprintf(o, `Usage: mlr [flags] {verb} [verb-dependent options ...] {zero or more file names} @@ -287,12 +285,10 @@ func ParseTerminalUsage(arg string) bool { return false } -// ================================================================ func handleDefault() { MainUsage(os.Stdout) } -// ---------------------------------------------------------------- func listTopics() { fmt.Println("Type 'mlr help {topic}' for any of the following:") for _, section := range handlerLookupTable.sections { @@ -313,7 +309,6 @@ func listTopics() { fmt.Printf("for all things with \"map\" in their names.\n") } -// ---------------------------------------------------------------- func showFlagsHelp() { cli.FLAG_TABLE.ShowHelp() } @@ -351,7 +346,6 @@ func helpTerminals() { // We can't invoke the terminal-lister since that would create a cyclic package reference. } -// ---------------------------------------------------------------- func helpBasicExamples() { fmt.Print( `mlr --icsv --opprint cat example.csv @@ -364,7 +358,6 @@ mlr --icsv --opprint --from example.csv sort -nr index then cut -f shape,quantit `) } -// ---------------------------------------------------------------- func helpFileFormats() { fmt.Printf( `CSV/CSV-lite: comma-separated values with separate header line @@ -461,7 +454,6 @@ DCF: Debian control file format `) } -// ---------------------------------------------------------------- func helpMlrrc() { fmt.Print( `You can set up personal defaults via a $HOME/.mlrrc and/or ./.mlrrc. @@ -499,12 +491,10 @@ https://miller.readthedocs.io/en/latest/customization.html `) } -// ---------------------------------------------------------------- func helpOutputColorization() { cli.OutputColorizationPrintInfo() } -// ---------------------------------------------------------------- func helpTypeArithmeticInfo() { helpTypeArithmeticInfoAux(false) } @@ -694,7 +684,6 @@ func showHelpForFlag(flagNames []string) { } } -// ---------------------------------------------------------------- func listVerbs() { if isatty.IsTerminal(os.Stdout.Fd()) { transformers.ListVerbNamesAsParagraph() @@ -721,7 +710,6 @@ func usageVerbs() { transformers.UsageVerbs() } -// ---------------------------------------------------------------- func listFunctions() { if isatty.IsTerminal(os.Stdout.Fd()) { cst.BuiltinFunctionManagerInstance.ListBuiltinFunctionNamesAsParagraph() @@ -843,7 +831,6 @@ func helpByApproximateSearchOne(thing string) bool { return found } -// ---------------------------------------------------------------- func listKeywords() { if isatty.IsTerminal(os.Stdout.Fd()) { cst.ListKeywordsAsParagraph() diff --git a/pkg/terminals/regtest/entry.go b/pkg/terminals/regtest/entry.go index b59c443c9..2abb91ee3 100644 --- a/pkg/terminals/regtest/entry.go +++ b/pkg/terminals/regtest/entry.go @@ -13,7 +13,6 @@ import ( const defaultPath = "./test/cases" -// ================================================================ func regTestUsage(verbName string, o *os.File, exitCode int) { fmt.Fprintf(o, "Usage: mlr %s [options] [one or more directories/files]\n", verbName) fmt.Fprintf(o, "If no directories/files are specified, the directory %s is used by default.\n", defaultPath) diff --git a/pkg/terminals/regtest/regtester.go b/pkg/terminals/regtest/regtester.go index 4734bf9ce..255452350 100644 --- a/pkg/terminals/regtest/regtester.go +++ b/pkg/terminals/regtest/regtester.go @@ -98,7 +98,6 @@ type stringPair struct { second string } -// ---------------------------------------------------------------- type RegTester struct { exeName string verbosityLevel int @@ -115,7 +114,6 @@ type RegTester struct { firstNFailsToShow int } -// ---------------------------------------------------------------- func NewRegTester( exeName string, doPopulate bool, @@ -272,7 +270,6 @@ func (regtester *RegTester) executeSinglePath( return false // fall-through } -// ---------------------------------------------------------------- func (regtester *RegTester) executeSingleDirectory( dirName string, ) (bool, bool) { @@ -753,7 +750,6 @@ func (regtester *RegTester) executeSingleCmdFile( return passed } -// ---------------------------------------------------------------- func (regtester *RegTester) FileExists(fileName string) bool { fileInfo, err := os.Stat(fileName) if err != nil { @@ -824,7 +820,6 @@ func (regtester *RegTester) compareFiles( return expectedContents == actualContents, expectedContents, actualContents, nil } -// ---------------------------------------------------------------- func (regtester *RegTester) loadEnvFile( filename string, caseDir string, @@ -861,7 +856,6 @@ func (regtester *RegTester) loadEnvFile( return keyValuePairs, nil } -// ---------------------------------------------------------------- func (regtester *RegTester) loadStringPairFile( filename string, caseDir string, diff --git a/pkg/terminals/repl/dsl.go b/pkg/terminals/repl/dsl.go index 78f3b98bb..7f70826b2 100644 --- a/pkg/terminals/repl/dsl.go +++ b/pkg/terminals/repl/dsl.go @@ -28,7 +28,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/mlrval" ) -// ---------------------------------------------------------------- func (repl *Repl) handleDSLStringImmediate(dslString string, doWarnings bool) error { return repl.handleDSLStringAux(dslString, true, doWarnings) } diff --git a/pkg/terminals/repl/entry.go b/pkg/terminals/repl/entry.go index 95d01f385..873edb736 100644 --- a/pkg/terminals/repl/entry.go +++ b/pkg/terminals/repl/entry.go @@ -30,7 +30,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/cli" ) -// ================================================================ func replUsage(verbName string, o *os.File, exitCode int) { exeName := path.Base(os.Args[0]) fmt.Fprintf(o, "Usage: %s %s [options] {zero or more data-file names}\n", exeName, verbName) diff --git a/pkg/terminals/repl/session.go b/pkg/terminals/repl/session.go index 2f25beb31..e3cada64a 100644 --- a/pkg/terminals/repl/session.go +++ b/pkg/terminals/repl/session.go @@ -35,7 +35,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- func NewRepl( exeName string, replName string, @@ -147,7 +146,6 @@ func controlCHandler(sysToSignalHandlerChannel chan os.Signal, appSignalNotifica } } -// ---------------------------------------------------------------- func (repl *Repl) handleSession(istream *os.File) error { if repl.showStartupBanner { repl.printStartupBanner() diff --git a/pkg/terminals/repl/types.go b/pkg/terminals/repl/types.go index 360a434a0..4f79914e7 100644 --- a/pkg/terminals/repl/types.go +++ b/pkg/terminals/repl/types.go @@ -16,7 +16,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ================================================================ type ASTPrintMode int const ( @@ -26,7 +25,6 @@ const ( ASTPrintIndent ) -// ================================================================ type Repl struct { // From os.Args[] as we were invoked. These are for printing error messages. exeName string diff --git a/pkg/terminals/repl/verbs.go b/pkg/terminals/repl/verbs.go index 0de4027dc..83027876e 100644 --- a/pkg/terminals/repl/verbs.go +++ b/pkg/terminals/repl/verbs.go @@ -140,7 +140,6 @@ func (repl *Repl) handleNonDSLLine(trimmedLine string) bool { return true } -// ---------------------------------------------------------------- func usageLoad(repl *Repl) { fmt.Println(":load {one or more filenames containing Miller DSL statements}") fmt.Println("If a filename is a directory, all \"*.mlr\" files will be loaded from within it.") @@ -177,7 +176,6 @@ func handleLoad(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageOpen(repl *Repl) { fmt.Printf( ":open {one or more data-file names in the format specified by mlr %s}.\n", @@ -248,7 +246,6 @@ func (repl *Repl) openFiles(filenames []string) { ) } -// ---------------------------------------------------------------- func usageReopen(repl *Repl) { fmt.Println(":reopen with no arguments.") fmt.Println("Like :open with the same filenames you provided at the time you typed :open.") @@ -266,7 +263,6 @@ func handleReopen(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageRead(repl *Repl) { fmt.Println(":read with no arguments.") fmt.Printf( @@ -320,7 +316,6 @@ func handleRead(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageContext(repl *Repl) { fmt.Println(":context with no arguments.") fmt.Println("Displays the current context variables: NR, FNR, FILENUM, FILENAME.") @@ -335,7 +330,6 @@ func handleContext(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageSkip(repl *Repl) { fmt.Println(":skip {n} to read n records without invoking :main statements or printing the records.") fmt.Printf( @@ -384,7 +378,6 @@ func handleSkip(repl *Repl, args []string) bool { } } -// ---------------------------------------------------------------- func usageProcess(repl *Repl) { fmt.Println(":process {n} to read n records, invoking :main statements on them, and printing the records.") fmt.Printf( @@ -433,7 +426,6 @@ func handleProcess(repl *Repl, args []string) bool { } } -// ---------------------------------------------------------------- func handleSkipOrProcessN(repl *Repl, n int64, processingNotSkipping bool) { var recordsAndContexts []*types.RecordAndContext // list of *types.RecordAndContext var err error = nil @@ -605,7 +597,6 @@ func skipOrProcessRecord( return false } -// ---------------------------------------------------------------- func usageWrite(repl *Repl) { fmt.Println(":write with no arguments.") fmt.Println("Sends the current record (maybe modified by statements you enter)") @@ -638,7 +629,6 @@ func writeRecord(repl *Repl, outrec *mlrval.Mlrmap) { repl.bufferedRecordOutputStream.Flush() } -// ---------------------------------------------------------------- func usageReadWrite(repl *Repl) { fmt.Println(":rw with no arguments.") fmt.Println("Same as ':r' followed by ':w'.") @@ -653,7 +643,6 @@ func handleReadWrite(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageRedirectWrite(repl *Repl) { fmt.Println(":> {filename} sends record-write output to the specified file.") fmt.Println(":> with no arguments sends record-write output to stdout.") @@ -690,7 +679,6 @@ func handleRedirectWrite(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageRedirectAppend(repl *Repl) { fmt.Println(":>> {filename}") fmt.Println("Appends record-write output to the specified file.") @@ -721,7 +709,6 @@ func handleRedirectAppend(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageBegin(repl *Repl) { fmt.Println(":begin with no arguments.") fmt.Println("Executes any begin {...} blocks which have been entered.") @@ -738,7 +725,6 @@ func handleBegin(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageMain(repl *Repl) { fmt.Println(":main with no arguments.") fmt.Println("Executes any statements outside of begin/end/func/subr which have been entered") @@ -756,7 +742,6 @@ func handleMain(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageEnd(repl *Repl) { fmt.Println(":end with no arguments.") fmt.Println("Executes any end {...} blocks which have been entered.") @@ -773,7 +758,6 @@ func handleEnd(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageASTPrint(repl *Repl) { fmt.Println(":astprint {format option}") fmt.Println("Shows the AST (abstract syntax tree) associated with DSL statements entered in.") @@ -803,7 +787,6 @@ func handleASTPrint(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageBlocks(repl *Repl) { fmt.Println(":blocks with no arguments.") fmt.Println("Shows the number of begin{...} blocks that have been loaded, the number") @@ -820,7 +803,6 @@ func handleBlocks(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageResetBlocks(repl *Repl) { fmt.Println(":resetblocks with no arguments clears out all begin, main, and end blocks that have been loaded.") fmt.Println(":resetblocks begin clears out begin blocks.") @@ -855,7 +837,6 @@ func handleResetBlocks(repl *Repl, args []string) bool { return true } -// ---------------------------------------------------------------- func usageQuit(repl *Repl) { fmt.Println(":quit with no arguments.") fmt.Println("Ends the Miller REPL session.") @@ -864,7 +845,6 @@ func usageQuit(repl *Repl) { // The :quit command is handled outside this file; we have a help function, // though, to expose it for online help. -// ---------------------------------------------------------------- func usageHelp(repl *Repl) { fmt.Println("Options:") fmt.Println(":help intro") @@ -1081,7 +1061,6 @@ etc. depending on your platform.`) fmt.Println("Type ':h' or ':help' to see more about your options. In particular, ':help examples'.") } -// ---------------------------------------------------------------- func showREPLExamples(repl *Repl) { fmt.Println(colorizer.MaybeColorizeHelp("Immediately executed statements", true)) fmt.Println( diff --git a/pkg/transformers/aaa_transformer_table.go b/pkg/transformers/aaa_transformer_table.go index b1a41ae17..fd8613d36 100644 --- a/pkg/transformers/aaa_transformer_table.go +++ b/pkg/transformers/aaa_transformer_table.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/lib" ) -// ---------------------------------------------------------------- var TRANSFORMER_LOOKUP_TABLE = []TransformerSetup{ AltkvSetup, BarSetup, @@ -130,7 +129,6 @@ func ListVerbNamesAsParagraph() { lib.PrintWordsAsParagraph(verbNames) } -// ---------------------------------------------------------------- func UsageVerbs() { separator := "================================================================" diff --git a/pkg/transformers/altkv.go b/pkg/transformers/altkv.go index add095e50..7ab3aa369 100644 --- a/pkg/transformers/altkv.go +++ b/pkg/transformers/altkv.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameAltkv = "altkv" var AltkvSetup = TransformerSetup{ @@ -76,7 +75,6 @@ func transformerAltkvParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerAltkv struct { } @@ -85,7 +83,6 @@ func NewTransformerAltkv() (*TransformerAltkv, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerAltkv) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/bar.go b/pkg/transformers/bar.go index 6aa5830c6..0bda6d6a1 100644 --- a/pkg/transformers/bar.go +++ b/pkg/transformers/bar.go @@ -18,7 +18,6 @@ const barDefaultLo = 0.0 const barDefaultHi = 100.0 const barDefaultWidth = int64(40) -// ---------------------------------------------------------------- const verbNameBar = "bar" var BarSetup = TransformerSetup{ @@ -140,7 +139,6 @@ func transformerBarParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerBar struct { fieldNames []string lo float64 @@ -155,7 +153,6 @@ type TransformerBar struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerBar( fieldNames []string, lo float64, @@ -202,7 +199,6 @@ func NewTransformerBar( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerBar) Transform( inrecAndContext *types.RecordAndContext, @@ -214,7 +210,6 @@ func (tr *TransformerBar) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerBar) processNoAuto( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -249,7 +244,6 @@ func (tr *TransformerBar) processNoAuto( } } -// ---------------------------------------------------------------- func (tr *TransformerBar) processAuto( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/bootstrap.go b/pkg/transformers/bootstrap.go index 8b8a11d51..811c24737 100644 --- a/pkg/transformers/bootstrap.go +++ b/pkg/transformers/bootstrap.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameBootstrap = "bootstrap" var BootstrapSetup = TransformerSetup{ @@ -88,7 +87,6 @@ func transformerBootstrapParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerBootstrap struct { recordsAndContexts []*types.RecordAndContext nout int64 @@ -102,7 +100,6 @@ func NewTransformerBootstrap(nout int64) (*TransformerBootstrap, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerBootstrap) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/case.go b/pkg/transformers/case.go index 9c9b5e827..115bbdad2 100644 --- a/pkg/transformers/case.go +++ b/pkg/transformers/case.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCase = "case" var CaseSetup = TransformerSetup{ @@ -117,7 +116,6 @@ func transformerCaseParseCLI( return transformer } -// ---------------------------------------------------------------- type caserFuncT func(input string) string type TransformerCase struct { diff --git a/pkg/transformers/cat.go b/pkg/transformers/cat.go index 39423d77a..395d5fc6d 100644 --- a/pkg/transformers/cat.go +++ b/pkg/transformers/cat.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCat = "cat" var CatSetup = TransformerSetup{ @@ -109,7 +108,6 @@ func transformerCatParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerCat struct { doCounters bool groupByFieldNames []string @@ -124,7 +122,6 @@ type TransformerCat struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerCat( doCounters bool, counterFieldName string, @@ -160,7 +157,6 @@ func NewTransformerCat( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerCat) Transform( inrecAndContext *types.RecordAndContext, @@ -177,7 +173,6 @@ func (tr *TransformerCat) Transform( ) } -// ---------------------------------------------------------------- func (tr *TransformerCat) simpleCat( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -195,7 +190,6 @@ func (tr *TransformerCat) simpleCat( *outputRecordsAndContexts = append(*outputRecordsAndContexts, inrecAndContext) } -// ---------------------------------------------------------------- func (tr *TransformerCat) countersUngrouped( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -218,7 +212,6 @@ func (tr *TransformerCat) countersUngrouped( *outputRecordsAndContexts = append(*outputRecordsAndContexts, inrecAndContext) } -// ---------------------------------------------------------------- func (tr *TransformerCat) countersGrouped( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/check.go b/pkg/transformers/check.go index ca842ee23..144e5d63b 100644 --- a/pkg/transformers/check.go +++ b/pkg/transformers/check.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCheck = "check" var CheckSetup = TransformerSetup{ @@ -79,7 +78,6 @@ func transformerCheckParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerCheck struct { // stateless messagedReEmptyKey map[string]bool diff --git a/pkg/transformers/clean_whitespace.go b/pkg/transformers/clean_whitespace.go index 017f4817a..528ac463d 100644 --- a/pkg/transformers/clean_whitespace.go +++ b/pkg/transformers/clean_whitespace.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCleanWhitespace = "clean-whitespace" var CleanWhitespaceSetup = TransformerSetup{ @@ -103,12 +102,10 @@ func transformerCleanWhitespaceParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerCleanWhitespace struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerCleanWhitespace( doKeys bool, doValues bool, @@ -127,8 +124,6 @@ func NewTransformerCleanWhitespace( return tr, nil } -// ---------------------------------------------------------------- - func (tr *TransformerCleanWhitespace) Transform( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -139,7 +134,6 @@ func (tr *TransformerCleanWhitespace) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerCleanWhitespace) cleanWhitespaceInKeysAndValues( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -163,7 +157,6 @@ func (tr *TransformerCleanWhitespace) cleanWhitespaceInKeysAndValues( } } -// ---------------------------------------------------------------- func (tr *TransformerCleanWhitespace) cleanWhitespaceInKeys( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -186,7 +179,6 @@ func (tr *TransformerCleanWhitespace) cleanWhitespaceInKeys( } } -// ---------------------------------------------------------------- func (tr *TransformerCleanWhitespace) cleanWhitespaceInValues( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/count.go b/pkg/transformers/count.go index a911a2004..66ec2e1d1 100644 --- a/pkg/transformers/count.go +++ b/pkg/transformers/count.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCount = "count" var CountSetup = TransformerSetup{ @@ -99,7 +98,6 @@ func transformerCountParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerCount struct { // input groupByFieldNames []string @@ -145,7 +143,6 @@ func NewTransformerCount( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerCount) Transform( inrecAndContext *types.RecordAndContext, @@ -157,7 +154,6 @@ func (tr *TransformerCount) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerCount) countUngrouped( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -175,7 +171,6 @@ func (tr *TransformerCount) countUngrouped( } } -// ---------------------------------------------------------------- func (tr *TransformerCount) countGrouped( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/count_similar.go b/pkg/transformers/count_similar.go index ff573edc2..a48536e08 100644 --- a/pkg/transformers/count_similar.go +++ b/pkg/transformers/count_similar.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCountSimilar = "count-similar" var CountSimilarSetup = TransformerSetup{ @@ -97,7 +96,6 @@ func transformerCountSimilarParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerCountSimilar struct { // Input: groupByFieldNames []string @@ -107,7 +105,6 @@ type TransformerCountSimilar struct { recordListsByGroup *lib.OrderedMap[*[]*types.RecordAndContext] // map from string to records } -// ---------------------------------------------------------------- func NewTransformerCountSimilar( groupByFieldNames []string, counterFieldName string, @@ -120,7 +117,6 @@ func NewTransformerCountSimilar( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerCountSimilar) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/cut.go b/pkg/transformers/cut.go index bdf3521e2..e394987f2 100644 --- a/pkg/transformers/cut.go +++ b/pkg/transformers/cut.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCut = "cut" var CutSetup = TransformerSetup{ @@ -124,7 +123,6 @@ func transformerCutParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerCut struct { fieldNameList []string fieldNameSet map[string]bool @@ -181,7 +179,6 @@ func NewTransformerCut( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerCut) Transform( inrecAndContext *types.RecordAndContext, @@ -266,7 +263,6 @@ type entryIndex struct { entry *mlrval.MlrmapEntry } -// ---------------------------------------------------------------- func (tr *TransformerCut) processWithRegexes( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/decimate.go b/pkg/transformers/decimate.go index 336e7d06e..f20ab31dc 100644 --- a/pkg/transformers/decimate.go +++ b/pkg/transformers/decimate.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameDecimate = "decimate" var DecimateSetup = TransformerSetup{ @@ -105,7 +104,6 @@ func transformerDecimateParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerDecimate struct { decimateCount int64 remainderToKeep int64 @@ -114,7 +112,6 @@ type TransformerDecimate struct { countsByGroup map[string]int64 } -// ---------------------------------------------------------------- func NewTransformerDecimate( decimateCount int64, atStart bool, @@ -137,7 +134,6 @@ func NewTransformerDecimate( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerDecimate) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/fill_down.go b/pkg/transformers/fill_down.go index bbe101f51..0328a0660 100644 --- a/pkg/transformers/fill_down.go +++ b/pkg/transformers/fill_down.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameFillDown = "fill-down" var FillDownSetup = TransformerSetup{ @@ -111,7 +110,6 @@ func transformerFillDownParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerFillDown struct { // input fillDownFieldNames []string @@ -143,7 +141,6 @@ func NewTransformerFillDown( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerFillDown) Transform( inrecAndContext *types.RecordAndContext, @@ -155,7 +152,6 @@ func (tr *TransformerFillDown) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerFillDown) transformSpecified( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -193,7 +189,6 @@ func (tr *TransformerFillDown) transformSpecified( } } -// ---------------------------------------------------------------- func (tr *TransformerFillDown) transformAll( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/fill_empty.go b/pkg/transformers/fill_empty.go index af8caee68..67658913b 100644 --- a/pkg/transformers/fill_empty.go +++ b/pkg/transformers/fill_empty.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameFillEmpty = "fill-empty" const defaultFillEmptyString = "N/A" @@ -87,7 +86,6 @@ func transformerFillEmptyParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerFillEmpty struct { fillValue *mlrval.Mlrval } @@ -105,7 +103,6 @@ func NewTransformerFillEmpty( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerFillEmpty) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/flatten.go b/pkg/transformers/flatten.go index f385a226b..7d9c6c942 100644 --- a/pkg/transformers/flatten.go +++ b/pkg/transformers/flatten.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameFlatten = "flatten" var FlattenSetup = TransformerSetup{ @@ -94,7 +93,6 @@ func transformerFlattenParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerFlatten struct { // input oFlatSep string @@ -129,7 +127,6 @@ func NewTransformerFlatten( return retval, nil } -// ---------------------------------------------------------------- func (tr *TransformerFlatten) Transform( inrecAndContext *types.RecordAndContext, @@ -141,7 +138,6 @@ func (tr *TransformerFlatten) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerFlatten) flattenAll( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -161,7 +157,6 @@ func (tr *TransformerFlatten) flattenAll( } } -// ---------------------------------------------------------------- func (tr *TransformerFlatten) flattenSome( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/format_values.go b/pkg/transformers/format_values.go index 6ff83cf1d..b39450838 100644 --- a/pkg/transformers/format_values.go +++ b/pkg/transformers/format_values.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameFormatValues = "format-values" const defaultFormatValuesStringFormat = "%s" @@ -24,7 +23,6 @@ var FormatValuesSetup = TransformerSetup{ IgnoresInput: false, } -// ---------------------------------------------------------------- func transformerFormatValuesUsage( o *os.File, ) { @@ -125,7 +123,6 @@ func transformerFormatValuesParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerFormatValues struct { stringFormatter mlrval.IFormatter intFormatter mlrval.IFormatter @@ -163,7 +160,6 @@ func NewTransformerFormatValues( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerFormatValues) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/fraction.go b/pkg/transformers/fraction.go index 91eb09866..2ef353975 100644 --- a/pkg/transformers/fraction.go +++ b/pkg/transformers/fraction.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameFraction = "fraction" var FractionSetup = TransformerSetup{ @@ -125,7 +124,6 @@ func transformerFractionParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerFraction struct { fractionFieldNames []string groupByFieldNames []string @@ -142,7 +140,6 @@ type TransformerFraction struct { zero *mlrval.Mlrval } -// ---------------------------------------------------------------- func NewTransformerFraction( fractionFieldNames []string, groupByFieldNames []string, @@ -187,7 +184,6 @@ func NewTransformerFraction( }, nil } -// ---------------------------------------------------------------- func (tr *TransformerFraction) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/gap.go b/pkg/transformers/gap.go index fbe70cc86..c4a628966 100644 --- a/pkg/transformers/gap.go +++ b/pkg/transformers/gap.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameGap = "gap" var GapSetup = TransformerSetup{ @@ -99,7 +98,6 @@ func transformerGapParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerGap struct { // input gapCount int64 @@ -133,7 +131,6 @@ func NewTransformerGap( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerGap) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/grep.go b/pkg/transformers/grep.go index efdbd8429..ba07b7a78 100644 --- a/pkg/transformers/grep.go +++ b/pkg/transformers/grep.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameGrep = "grep" var GrepSetup = TransformerSetup{ @@ -130,7 +129,6 @@ func transformerGrepParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerGrep struct { regexp *regexp.Regexp invert bool @@ -150,7 +148,6 @@ func NewTransformerGrep( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerGrep) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/group_by.go b/pkg/transformers/group_by.go index c9916be46..7a7655ef2 100644 --- a/pkg/transformers/group_by.go +++ b/pkg/transformers/group_by.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameGroupBy = "group-by" var GroupBySetup = TransformerSetup{ @@ -85,7 +84,6 @@ func transformerGroupByParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerGroupBy struct { // input groupByFieldNames []string @@ -108,7 +106,6 @@ func NewTransformerGroupBy( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerGroupBy) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/group_like.go b/pkg/transformers/group_like.go index aa18da3aa..4ffedd1d6 100644 --- a/pkg/transformers/group_like.go +++ b/pkg/transformers/group_like.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameGroupLike = "group-like" var GroupLikeSetup = TransformerSetup{ @@ -75,7 +74,6 @@ func transformerGroupLikeParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerGroupLike struct { // map from string to record slices recordListsByGroup *lib.OrderedMap[*[]*types.RecordAndContext] @@ -90,7 +88,6 @@ func NewTransformerGroupLike() (*TransformerGroupLike, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerGroupLike) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/having_fields.go b/pkg/transformers/having_fields.go index bd6ef9ae5..fb634c729 100644 --- a/pkg/transformers/having_fields.go +++ b/pkg/transformers/having_fields.go @@ -23,7 +23,6 @@ const ( havingNoFieldsMatching ) -// ---------------------------------------------------------------- const verbNameHavingFields = "having-fields" var HavingFieldsSetup = TransformerSetup{ @@ -150,7 +149,6 @@ func transformerHavingFieldsParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerHavingFields struct { fieldNames []string numFieldNames int64 @@ -161,7 +159,6 @@ type TransformerHavingFields struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerHavingFields( havingFieldsCriterion tHavingFieldsCriterion, fieldNames []string, @@ -216,7 +213,6 @@ func NewTransformerHavingFields( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerHavingFields) Transform( inrecAndContext *types.RecordAndContext, @@ -228,7 +224,6 @@ func (tr *TransformerHavingFields) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerHavingFields) transformHavingFieldsAtLeast( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -294,7 +289,6 @@ func (tr *TransformerHavingFields) transformHavingFieldsAtMost( } } -// ---------------------------------------------------------------- func (tr *TransformerHavingFields) transformHavingAllFieldsMatching( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/head.go b/pkg/transformers/head.go index c62abca38..e0d318491 100644 --- a/pkg/transformers/head.go +++ b/pkg/transformers/head.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameHead = "head" var HeadSetup = TransformerSetup{ @@ -101,7 +100,6 @@ func transformerHeadParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerHead struct { // input headCount int64 @@ -138,7 +136,6 @@ func NewTransformerHead( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerHead) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/histogram.go b/pkg/transformers/histogram.go index d6d4c5ec0..14a3c157c 100644 --- a/pkg/transformers/histogram.go +++ b/pkg/transformers/histogram.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameHistogram = "histogram" const histogramDefaultBinCount = int64(20) @@ -134,7 +133,6 @@ func transformerHistogramParseCLI( return transformer } -// ---------------------------------------------------------------- const histogramVectorInitialSize = 1024 type TransformerHistogram struct { @@ -151,7 +149,6 @@ type TransformerHistogram struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerHistogram( valueFieldNames []string, lo float64, @@ -193,7 +190,6 @@ func NewTransformerHistogram( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerHistogram) Transform( inrecAndContext *types.RecordAndContext, @@ -205,7 +201,6 @@ func (tr *TransformerHistogram) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerHistogram) transformNonAuto( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -278,7 +273,6 @@ func (tr *TransformerHistogram) emitNonAuto( } } -// ---------------------------------------------------------------- func (tr *TransformerHistogram) transformAuto( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/join.go b/pkg/transformers/join.go index 290875b37..efd355187 100644 --- a/pkg/transformers/join.go +++ b/pkg/transformers/join.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameJoin = "join" var JoinSetup = TransformerSetup{ @@ -72,7 +71,6 @@ func newJoinOptions() *tJoinOptions { } } -// ---------------------------------------------------------------- func transformerJoinUsage( o *os.File, ) { @@ -133,7 +131,6 @@ func transformerJoinUsage( fmt.Fprintf(o, "including examples.\n") } -// ---------------------------------------------------------------- func transformerJoinParseCLI( pargi *int, argc int, @@ -284,7 +281,6 @@ func transformerJoinParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerJoin struct { opts *tJoinOptions @@ -303,7 +299,6 @@ type TransformerJoin struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerJoin( opts *tJoinOptions, ) (*TransformerJoin, error) { @@ -356,7 +351,6 @@ func NewTransformerJoin( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerJoin) Transform( inrecAndContext *types.RecordAndContext, @@ -422,7 +416,6 @@ func (tr *TransformerJoin) transformHalfStreaming( } } -// ---------------------------------------------------------------- func (tr *TransformerJoin) transformDoublyStreaming( rightRecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/json_parse.go b/pkg/transformers/json_parse.go index 324e4bc5f..cfb46553e 100644 --- a/pkg/transformers/json_parse.go +++ b/pkg/transformers/json_parse.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameJSONParse = "json-parse" var JSONParseSetup = TransformerSetup{ @@ -94,7 +93,6 @@ func transformerJSONParseParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerJSONParse struct { // input fieldNameSet map[string]bool @@ -126,7 +124,6 @@ func NewTransformerJSONParse( return retval, nil } -// ---------------------------------------------------------------- func (tr *TransformerJSONParse) Transform( inrecAndContext *types.RecordAndContext, @@ -138,7 +135,6 @@ func (tr *TransformerJSONParse) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerJSONParse) jsonParseAll( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -160,7 +156,6 @@ func (tr *TransformerJSONParse) jsonParseAll( } } -// ---------------------------------------------------------------- func (tr *TransformerJSONParse) jsonParseSome( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/json_stringify.go b/pkg/transformers/json_stringify.go index 6c88523f7..c294fb789 100644 --- a/pkg/transformers/json_stringify.go +++ b/pkg/transformers/json_stringify.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameJSONStringify = "json-stringify" var JSONStringifySetup = TransformerSetup{ @@ -104,7 +103,6 @@ func transformerJSONStringifyParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerJSONStringify struct { // input jsonFormatting mlrval.TJSONFormatting @@ -136,7 +134,6 @@ func NewTransformerJSONStringify( return retval, nil } -// ---------------------------------------------------------------- func (tr *TransformerJSONStringify) Transform( inrecAndContext *types.RecordAndContext, @@ -148,7 +145,6 @@ func (tr *TransformerJSONStringify) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerJSONStringify) jsonStringifyAll( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -166,7 +162,6 @@ func (tr *TransformerJSONStringify) jsonStringifyAll( } } -// ---------------------------------------------------------------- func (tr *TransformerJSONStringify) jsonStringifySome( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/label.go b/pkg/transformers/label.go index ac7d748be..5a1e9b79e 100644 --- a/pkg/transformers/label.go +++ b/pkg/transformers/label.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameLabel = "label" var LabelSetup = TransformerSetup{ @@ -90,7 +89,6 @@ func transformerLabelParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerLabel struct { newNames []string } @@ -115,7 +113,6 @@ func NewTransformerLabel( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerLabel) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/latin1_to_utf8.go b/pkg/transformers/latin1_to_utf8.go index 8aca9885d..db85eb842 100644 --- a/pkg/transformers/latin1_to_utf8.go +++ b/pkg/transformers/latin1_to_utf8.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameLatin1ToUTF8 = "latin1-to-utf8" var Latin1ToUTF8Setup = TransformerSetup{ @@ -77,7 +76,6 @@ func transformerLatin1ToUTF8ParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerLatin1ToUTF8 struct { } @@ -86,7 +84,6 @@ func NewTransformerLatin1ToUTF8() (*TransformerLatin1ToUTF8, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerLatin1ToUTF8) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/merge_fields.go b/pkg/transformers/merge_fields.go index 7ff5a39f8..f833ff7eb 100644 --- a/pkg/transformers/merge_fields.go +++ b/pkg/transformers/merge_fields.go @@ -12,7 +12,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameMergeFields = "merge-fields" var MergeFieldsSetup = TransformerSetup{ @@ -307,7 +306,6 @@ func NewTransformerMergeFields( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerMergeFields) Transform( inrecAndContext *types.RecordAndContext, @@ -319,7 +317,6 @@ func (tr *TransformerMergeFields) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerMergeFields) transformByNameList( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -370,7 +367,6 @@ func (tr *TransformerMergeFields) transformByNameList( *outputRecordsAndContexts = append(*outputRecordsAndContexts, inrecAndContext) } -// ---------------------------------------------------------------- func (tr *TransformerMergeFields) transformByNameRegex( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/most_or_least_frequent.go b/pkg/transformers/most_or_least_frequent.go index 321c93296..5518eb764 100644 --- a/pkg/transformers/most_or_least_frequent.go +++ b/pkg/transformers/most_or_least_frequent.go @@ -12,7 +12,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameMostFrequent = "most-frequent" const verbNameLeastFrequent = "least-frequent" @@ -163,7 +162,6 @@ func transformerMostOrLeastFrequentParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerMostOrLeastFrequent struct { groupByFieldNames []string maxOutputLength int64 @@ -179,7 +177,6 @@ type tMostOrLeastFrequentSortPair struct { groupingKey string } -// ---------------------------------------------------------------- func NewTransformerMostOrLeastFrequent( groupByFieldNames []string, maxOutputLength int64, @@ -200,7 +197,6 @@ func NewTransformerMostOrLeastFrequent( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerMostOrLeastFrequent) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/nest.go b/pkg/transformers/nest.go index e765eb2b5..953d0262c 100644 --- a/pkg/transformers/nest.go +++ b/pkg/transformers/nest.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameNest = "nest" var NestSetup = TransformerSetup{ @@ -247,7 +246,6 @@ func transformerNestParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerNest struct { fieldName string nestedFS string @@ -265,7 +263,6 @@ type TransformerNest struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerNest( fieldName string, doRegexes bool, @@ -344,8 +341,6 @@ func NewTransformerNest( return tr, nil } -// ---------------------------------------------------------------- - func (tr *TransformerNest) Transform( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -375,7 +370,6 @@ func (tr *TransformerNest) getMatchingFieldNames(inrec *mlrval.Mlrmap) []string return names } -// ---------------------------------------------------------------- func (tr *TransformerNest) explodeValuesAcrossFields( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -420,7 +414,6 @@ func (tr *TransformerNest) explodeValuesAcrossFields( } } -// ---------------------------------------------------------------- func (tr *TransformerNest) explodeValuesAcrossRecords( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -456,7 +449,6 @@ func (tr *TransformerNest) explodeValuesAcrossRecords( } } -// ---------------------------------------------------------------- func (tr *TransformerNest) explodePairsAcrossFields( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -509,7 +501,6 @@ func (tr *TransformerNest) explodePairsAcrossFields( } } -// ---------------------------------------------------------------- func (tr *TransformerNest) explodePairsAcrossRecords( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -556,7 +547,6 @@ func (tr *TransformerNest) explodePairsAcrossRecords( } } -// ---------------------------------------------------------------- func (tr *TransformerNest) implodeValuesAcrossFields( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -605,7 +595,6 @@ func (tr *TransformerNest) implodeValuesAcrossFields( } } -// ---------------------------------------------------------------- func (tr *TransformerNest) implodeValueAcrossRecords( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/nothing.go b/pkg/transformers/nothing.go index fa90f2349..e32ed0243 100644 --- a/pkg/transformers/nothing.go +++ b/pkg/transformers/nothing.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameNothing = "nothing" var NothingSetup = TransformerSetup{ @@ -75,7 +74,6 @@ func transformerNothingParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerNothing struct { // stateless } diff --git a/pkg/transformers/put_or_filter.go b/pkg/transformers/put_or_filter.go index 32a40d25d..9ac4faf91 100644 --- a/pkg/transformers/put_or_filter.go +++ b/pkg/transformers/put_or_filter.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNamePut = "put" var PutSetup = TransformerSetup{ @@ -33,7 +32,6 @@ var FilterSetup = TransformerSetup{ IgnoresInput: false, } -// ---------------------------------------------------------------- func transformerPutUsage( o *os.File, ) { @@ -180,7 +178,6 @@ More example filter expressions: fmt.Fprintf(o, "See also %s/reference-dsl for more context.\n", lib.DOC_URL) } -// ---------------------------------------------------------------- func transformerPutOrFilterParseCLI( pargi *int, argc int, @@ -390,7 +387,6 @@ func transformerPutOrFilterParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerPut struct { doFilter bool // false for the put verb, true for the filter verb cstRootNode *cst.RootNode diff --git a/pkg/transformers/regularize.go b/pkg/transformers/regularize.go index bf571106f..5c7464c40 100644 --- a/pkg/transformers/regularize.go +++ b/pkg/transformers/regularize.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameRegularize = "regularize" var RegularizeSetup = TransformerSetup{ @@ -76,7 +75,6 @@ func transformerRegularizeParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerRegularize struct { // map from string to []string sortedToOriginal map[string][]string @@ -89,7 +87,6 @@ func NewTransformerRegularize() (*TransformerRegularize, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerRegularize) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/remove_empty_columns.go b/pkg/transformers/remove_empty_columns.go index 33f9eb83b..8545818a6 100644 --- a/pkg/transformers/remove_empty_columns.go +++ b/pkg/transformers/remove_empty_columns.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameRemoveEmptyColumns = "remove-empty-columns" var RemoveEmptyColumnsSetup = TransformerSetup{ @@ -75,7 +74,6 @@ func transformerRemoveEmptyColumnsParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerRemoveEmptyColumns struct { recordsAndContexts []*types.RecordAndContext namesWithNonEmptyValues map[string]bool diff --git a/pkg/transformers/rename.go b/pkg/transformers/rename.go index c6d928d86..386ee7b2d 100644 --- a/pkg/transformers/rename.go +++ b/pkg/transformers/rename.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameRename = "rename" var RenameSetup = TransformerSetup{ @@ -125,7 +124,6 @@ func transformerRenameParseCLI( return transformer } -// ---------------------------------------------------------------- type tRegexAndReplacement struct { regex *regexp.Regexp replacement string @@ -183,7 +181,6 @@ func NewTransformerRename( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerRename) Transform( inrecAndContext *types.RecordAndContext, @@ -195,7 +192,6 @@ func (tr *TransformerRename) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerRename) transformWithoutRegexes( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -216,7 +212,6 @@ func (tr *TransformerRename) transformWithoutRegexes( *outputRecordsAndContexts = append(*outputRecordsAndContexts, inrecAndContext) // including end-of-stream marker } -// ---------------------------------------------------------------- func (tr *TransformerRename) transformWithRegexes( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/reorder.go b/pkg/transformers/reorder.go index 0604bb531..eca31f958 100644 --- a/pkg/transformers/reorder.go +++ b/pkg/transformers/reorder.go @@ -12,7 +12,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameReorder = "reorder" var ReorderSetup = TransformerSetup{ @@ -133,7 +132,6 @@ func transformerReorderParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerReorder struct { // input fieldNames []string diff --git a/pkg/transformers/repeat.go b/pkg/transformers/repeat.go index cc9656c3d..6fe570ca6 100644 --- a/pkg/transformers/repeat.go +++ b/pkg/transformers/repeat.go @@ -17,7 +17,6 @@ const ( repeatCountFromFieldName ) -// ---------------------------------------------------------------- const verbNameRepeat = "repeat" var RepeatSetup = TransformerSetup{ @@ -126,14 +125,12 @@ func transformerRepeatParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerRepeat struct { repeatCount int64 repeatCountFieldName string recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerRepeat( repeatCountSource tRepeatCountSource, repeatCount int64, @@ -154,7 +151,6 @@ func NewTransformerRepeat( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerRepeat) Transform( inrecAndContext *types.RecordAndContext, @@ -166,7 +162,6 @@ func (tr *TransformerRepeat) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerRepeat) repeatByCount( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -185,7 +180,6 @@ func (tr *TransformerRepeat) repeatByCount( } } -// ---------------------------------------------------------------- func (tr *TransformerRepeat) repeatByFieldName( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/reshape.go b/pkg/transformers/reshape.go index 12f8b4723..7c2d35f87 100644 --- a/pkg/transformers/reshape.go +++ b/pkg/transformers/reshape.go @@ -39,7 +39,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameReshape = "reshape" var ReshapeSetup = TransformerSetup{ @@ -221,7 +220,6 @@ func transformerReshapeParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerReshape struct { // for wide-to-long: inputFieldNames []string @@ -237,7 +235,6 @@ type TransformerReshape struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerReshape( inputFieldNames []string, inputFieldRegexStrings []string, @@ -287,7 +284,6 @@ func NewTransformerReshape( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerReshape) Transform( inrecAndContext *types.RecordAndContext, @@ -299,7 +295,6 @@ func (tr *TransformerReshape) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerReshape) wideToLongNoRegex( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -338,7 +333,6 @@ func (tr *TransformerReshape) wideToLongNoRegex( } } -// ---------------------------------------------------------------- func (tr *TransformerReshape) wideToLongRegex( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -380,7 +374,6 @@ func (tr *TransformerReshape) wideToLongRegex( } } -// ---------------------------------------------------------------- func (tr *TransformerReshape) longToWide( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/sample.go b/pkg/transformers/sample.go index 55e8db7e0..6326e9b33 100644 --- a/pkg/transformers/sample.go +++ b/pkg/transformers/sample.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSample = "sample" var SampleSetup = TransformerSetup{ @@ -98,7 +97,6 @@ func transformerSampleParseCLI( return transformer } -// ---------------------------------------------------------------- type sampleBucketType struct { nalloc int64 nused int64 @@ -123,7 +121,6 @@ func NewTransformerSample( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerSample) Transform( inrecAndContext *types.RecordAndContext, @@ -160,7 +157,6 @@ func (tr *TransformerSample) Transform( } } -// ---------------------------------------------------------------- func newSampleBucket(sampleCount int64) *sampleBucketType { return &sampleBucketType{ nalloc: sampleCount, diff --git a/pkg/transformers/sec2gmt.go b/pkg/transformers/sec2gmt.go index e0d63f77f..8bdef34fe 100644 --- a/pkg/transformers/sec2gmt.go +++ b/pkg/transformers/sec2gmt.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSec2GMT = "sec2gmt" var Sec2GMTSetup = TransformerSetup{ @@ -124,7 +123,6 @@ func transformerSec2GMTParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSec2GMT struct { fieldNameList []string preDivide float64 @@ -144,7 +142,6 @@ func NewTransformerSec2GMT( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerSec2GMT) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/sec2gmtdate.go b/pkg/transformers/sec2gmtdate.go index 73fcbda4d..5dd6cc06f 100644 --- a/pkg/transformers/sec2gmtdate.go +++ b/pkg/transformers/sec2gmtdate.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSec2GMTDate = "sec2gmtdate" var Sec2GMTDateSetup = TransformerSetup{ @@ -87,7 +86,6 @@ func transformerSec2GMTDateParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSec2GMTDate struct { fieldNameList []string } @@ -101,7 +99,6 @@ func NewTransformerSec2GMTDate( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerSec2GMTDate) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/seqgen.go b/pkg/transformers/seqgen.go index 608a50f63..057191758 100644 --- a/pkg/transformers/seqgen.go +++ b/pkg/transformers/seqgen.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSeqgen = "seqgen" var SeqgenSetup = TransformerSetup{ @@ -110,7 +109,6 @@ func transformerSeqgenParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSeqgen struct { fieldName string start *mlrval.Mlrval @@ -120,7 +118,6 @@ type TransformerSeqgen struct { mdone *mlrval.Mlrval } -// ---------------------------------------------------------------- func NewTransformerSeqgen( fieldName string, startString string, diff --git a/pkg/transformers/shuffle.go b/pkg/transformers/shuffle.go index 26e92deeb..11017de82 100644 --- a/pkg/transformers/shuffle.go +++ b/pkg/transformers/shuffle.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameShuffle = "shuffle" var ShuffleSetup = TransformerSetup{ @@ -78,7 +77,6 @@ func transformerShuffleParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerShuffle struct { recordsAndContexts []*types.RecordAndContext } @@ -92,7 +90,6 @@ func NewTransformerShuffle() (*TransformerShuffle, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerShuffle) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/skip_trivial_records.go b/pkg/transformers/skip_trivial_records.go index fa5b4d7e8..df1d8645e 100644 --- a/pkg/transformers/skip_trivial_records.go +++ b/pkg/transformers/skip_trivial_records.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSkipTrivialRecords = "skip-trivial-records" var SkipTrivialRecordsSetup = TransformerSetup{ @@ -75,7 +74,6 @@ func transformerSkipTrivialRecordsParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSkipTrivialRecords struct { } @@ -84,7 +82,6 @@ func NewTransformerSkipTrivialRecords() (*TransformerSkipTrivialRecords, error) return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerSkipTrivialRecords) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/sort.go b/pkg/transformers/sort.go index 24f7c0f44..63e211cb8 100644 --- a/pkg/transformers/sort.go +++ b/pkg/transformers/sort.go @@ -53,7 +53,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSort = "sort" var SortSetup = TransformerSetup{ @@ -338,7 +337,6 @@ func NewTransformerSort( return tr, nil } -// ---------------------------------------------------------------- type GroupingKeysAndMlrvals struct { groupingKey string mlrvals []*mlrval.Mlrval diff --git a/pkg/transformers/sort_within_records.go b/pkg/transformers/sort_within_records.go index 0c38fbd25..0f65b1653 100644 --- a/pkg/transformers/sort_within_records.go +++ b/pkg/transformers/sort_within_records.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSortWithinRecords = "sort-within-records" var SortWithinRecordsSetup = TransformerSetup{ @@ -82,7 +81,6 @@ func transformerSortWithinRecordsParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSortWithinRecords struct { recordTransformerFunc RecordTransformerFunc } @@ -101,8 +99,6 @@ func NewTransformerSortWithinRecords( return tr, nil } -// ---------------------------------------------------------------- - func (tr *TransformerSortWithinRecords) Transform( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -113,7 +109,6 @@ func (tr *TransformerSortWithinRecords) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerSortWithinRecords) transformNonrecursively( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -127,7 +122,6 @@ func (tr *TransformerSortWithinRecords) transformNonrecursively( *outputRecordsAndContexts = append(*outputRecordsAndContexts, inrecAndContext) // including end-of-stream marker } -// ---------------------------------------------------------------- func (tr *TransformerSortWithinRecords) transformRecursively( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/sparsify.go b/pkg/transformers/sparsify.go index 1f5076e83..57789b5f2 100644 --- a/pkg/transformers/sparsify.go +++ b/pkg/transformers/sparsify.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSparsify = "sparsify" var SparsifySetup = TransformerSetup{ @@ -100,7 +99,6 @@ func transformerSparsifyParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSparsify struct { fillerString string fieldNamesSet map[string]bool @@ -165,7 +163,6 @@ func (tr *TransformerSparsify) transformAll( *outputRecordsAndContexts = append(*outputRecordsAndContexts, outrecAndContext) } -// ---------------------------------------------------------------- func (tr *TransformerSparsify) transformSome( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/split.go b/pkg/transformers/split.go index 270726df7..89c07e231 100644 --- a/pkg/transformers/split.go +++ b/pkg/transformers/split.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSplit = "split" const splitDefaultOutputFileNamePrefix = "split" const splitDefaultFileNamePartJoiner = "_" @@ -213,7 +212,6 @@ func transformerSplitParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerSplit struct { n int64 outputFileNamePrefix string diff --git a/pkg/transformers/stats1.go b/pkg/transformers/stats1.go index 83cddbe4f..7fecba680 100644 --- a/pkg/transformers/stats1.go +++ b/pkg/transformers/stats1.go @@ -14,7 +14,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameStats1 = "stats1" var Stats1Setup = TransformerSetup{ @@ -214,7 +213,6 @@ func transformerStats1ParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerStats1 struct { // Input: accumulatorNameList []string diff --git a/pkg/transformers/stats2.go b/pkg/transformers/stats2.go index 280401a70..368a23ed9 100644 --- a/pkg/transformers/stats2.go +++ b/pkg/transformers/stats2.go @@ -12,7 +12,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameStats2 = "stats2" // For joining "x" and "y" into "x...y" for map keys. "," is another natural choice but would break @@ -57,7 +56,6 @@ func transformerStats2Usage( fmt.Fprintf(o, "Example: %s %s -a corr -f x,y\n", argv0, verb) } -// ---------------------------------------------------------------- func transformerStats2ParseCLI( pargi *int, argc int, @@ -168,7 +166,6 @@ func transformerStats2ParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerStats2 struct { // Input: accumulatorNameList []string @@ -260,7 +257,6 @@ func NewTransformerStats2( // In the non-iterative case, produce output only at the end of the input stream. // ================================================================ -// ---------------------------------------------------------------- func (tr *TransformerStats2) Transform( inrecAndContext *types.RecordAndContext, @@ -291,7 +287,6 @@ func (tr *TransformerStats2) Transform( } } -// ---------------------------------------------------------------- func (tr *TransformerStats2) ingest( inrecAndContext *types.RecordAndContext, ) { @@ -380,7 +375,6 @@ func (tr *TransformerStats2) ingest( } } -// ---------------------------------------------------------------- func (tr *TransformerStats2) emit( outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext context *types.Context, diff --git a/pkg/transformers/step.go b/pkg/transformers/step.go index 2ea727ed3..4c63e8b47 100644 --- a/pkg/transformers/step.go +++ b/pkg/transformers/step.go @@ -83,7 +83,6 @@ import ( // For EWMA const DEFAULT_STRING_ALPHA = "0.5" -// ---------------------------------------------------------------- const verbNameStep = "step" var StepSetup = TransformerSetup{ @@ -693,7 +692,6 @@ func allocateStepper( // ================================================================ // Implementations of individual steppers, like "delta" or "rsum" -// ================================================================ type tStepperDelta struct { inputFieldName string outputFieldName string @@ -826,7 +824,6 @@ func (stepper *tStepperShiftLag) process( } } -// ================================================================ type tStepperShiftLead struct { inputFieldName string outputFieldName string @@ -877,7 +874,6 @@ func (stepper *tStepperShiftLead) process( } } -// ================================================================ type tStepperFromFirst struct { first *mlrval.Mlrval inputFieldName string @@ -927,7 +923,6 @@ func (stepper *tStepperFromFirst) process( currec.PutCopy(stepper.outputFieldName, fromFirst) } -// ================================================================ type tStepperRatio struct { inputFieldName string outputFieldName string @@ -984,7 +979,6 @@ func (stepper *tStepperRatio) process( currec.PutCopy(stepper.outputFieldName, ratio.Copy()) } -// ================================================================ type tStepperRprod struct { rprod *mlrval.Mlrval inputFieldName string @@ -1033,7 +1027,6 @@ func (stepper *tStepperRprod) process( } } -// ================================================================ type tStepperRsum struct { rsum *mlrval.Mlrval inputFieldName string @@ -1082,7 +1075,6 @@ func (stepper *tStepperRsum) process( } } -// ================================================================ type tStepperCounter struct { counter *mlrval.Mlrval inputFieldName string @@ -1232,7 +1224,6 @@ func (stepper *tStepperEWMA) process( } } -// ================================================================ type tStepperSlwin struct { inputFieldName string numRecordsBackward int diff --git a/pkg/transformers/subs.go b/pkg/transformers/subs.go index 85daa5169..f39c703a6 100644 --- a/pkg/transformers/subs.go +++ b/pkg/transformers/subs.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSub = "sub" const verbNameGsub = "gsub" const verbNameSsub = "ssub" diff --git a/pkg/transformers/summary.go b/pkg/transformers/summary.go index 27a443fc6..ccdd18b38 100644 --- a/pkg/transformers/summary.go +++ b/pkg/transformers/summary.go @@ -12,7 +12,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameSummary = "summary" type tSummarizerType int @@ -210,7 +209,6 @@ func transformerSummaryParseCLI( return transformer } -// ---------------------------------------------------------------- type tFieldSummary struct { // Needs lib.OrderedMap, not map[string]int64, for deterministic regression-test output. // This is a map (a set really) rather than a single value in case of heterogeneous data. @@ -287,7 +285,6 @@ func NewTransformerSummary( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerSummary) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/surv.go b/pkg/transformers/surv.go index d2cf289c6..541debfce 100644 --- a/pkg/transformers/surv.go +++ b/pkg/transformers/surv.go @@ -12,7 +12,6 @@ import ( "github.com/kshedden/statmodel/statmodel" ) -// ---------------------------------------------------------------- const verbNameSurv = "surv" // SurvSetup defines the surv verb: Kaplan-Meier survival curve. diff --git a/pkg/transformers/tac.go b/pkg/transformers/tac.go index 58bcad121..36f55e703 100644 --- a/pkg/transformers/tac.go +++ b/pkg/transformers/tac.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameTac = "tac" var TacSetup = TransformerSetup{ @@ -74,7 +73,6 @@ func transformerTacParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerTac struct { recordsAndContexts []*types.RecordAndContext } diff --git a/pkg/transformers/tail.go b/pkg/transformers/tail.go index a6c56257f..108fa5d7c 100644 --- a/pkg/transformers/tail.go +++ b/pkg/transformers/tail.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameTail = "tail" var TailSetup = TransformerSetup{ @@ -101,7 +100,6 @@ func transformerTailParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerTail struct { // input tailCount int64 @@ -127,7 +125,6 @@ func NewTransformerTail( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerTail) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/tee.go b/pkg/transformers/tee.go index 5f5f21943..f915e3513 100644 --- a/pkg/transformers/tee.go +++ b/pkg/transformers/tee.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameTee = "tee" var TeeSetup = TransformerSetup{ @@ -128,7 +127,6 @@ func transformerTeeParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerTee struct { filenameOrCommandForDisplay string fileOutputHandler *output.FileOutputHandler diff --git a/pkg/transformers/template.go b/pkg/transformers/template.go index 656c995d0..398699e22 100644 --- a/pkg/transformers/template.go +++ b/pkg/transformers/template.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameTemplate = "template" var TemplateSetup = TransformerSetup{ @@ -112,7 +111,6 @@ func transformerTemplateParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerTemplate struct { fieldNameList []string fieldNameSet map[string]bool @@ -130,7 +128,6 @@ func NewTransformerTemplate( }, nil } -// ---------------------------------------------------------------- func (tr *TransformerTemplate) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/top.go b/pkg/transformers/top.go index 53c18d6d5..6a3e7d346 100644 --- a/pkg/transformers/top.go +++ b/pkg/transformers/top.go @@ -12,7 +12,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameTop = "top" const verbTopDefaultOutputFieldName = "top_idx" @@ -131,7 +130,6 @@ func transformerTopParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerTop struct { topCount int64 valueFieldNames []string @@ -146,7 +144,6 @@ type TransformerTop struct { groupingKeysToGroupByFieldValues map[string][]*mlrval.Mlrval } -// ---------------------------------------------------------------- func NewTransformerTop( topCount int64, valueFieldNames []string, @@ -234,7 +231,6 @@ func (tr *TransformerTop) ingest( } -// ---------------------------------------------------------------- func (tr *TransformerTop) emit( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/unflatten.go b/pkg/transformers/unflatten.go index f3b2ca184..e36d5f2fe 100644 --- a/pkg/transformers/unflatten.go +++ b/pkg/transformers/unflatten.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameUnflatten = "unflatten" var UnflattenSetup = TransformerSetup{ @@ -94,7 +93,6 @@ func transformerUnflattenParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerUnflatten struct { // input oFlatSep string @@ -128,7 +126,6 @@ func NewTransformerUnflatten( return retval, nil } -// ---------------------------------------------------------------- func (tr *TransformerUnflatten) Transform( inrecAndContext *types.RecordAndContext, @@ -140,7 +137,6 @@ func (tr *TransformerUnflatten) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerUnflatten) unflattenAll( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -160,7 +156,6 @@ func (tr *TransformerUnflatten) unflattenAll( } } -// ---------------------------------------------------------------- func (tr *TransformerUnflatten) unflattenSome( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/uniq.go b/pkg/transformers/uniq.go index aabc88ce7..7a0e87a79 100644 --- a/pkg/transformers/uniq.go +++ b/pkg/transformers/uniq.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameCountDistinct = "count-distinct" const verbNameUniq = "uniq" const uniqDefaultOutputFieldName = "count" @@ -30,7 +29,6 @@ var UniqSetup = TransformerSetup{ IgnoresInput: false, } -// ---------------------------------------------------------------- func transformerCountDistinctUsage( o *os.File, ) { @@ -143,7 +141,6 @@ func transformerCountDistinctParseCLI( return transformer } -// ---------------------------------------------------------------- func transformerUniqUsage( o *os.File, ) { @@ -261,7 +258,6 @@ func transformerUniqParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerUniq struct { fieldNames []string fieldNamesSet map[string]bool @@ -304,7 +300,6 @@ type TransformerUniq struct { recordTransformerFunc RecordTransformerFunc } -// ---------------------------------------------------------------- func NewTransformerUniq( fieldNames []string, invertFieldNames bool, @@ -352,7 +347,6 @@ func NewTransformerUniq( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerUniq) getFieldNamesForGrouping( inrec *mlrval.Mlrmap, @@ -461,7 +455,6 @@ func (tr *TransformerUniq) transformUniqifyEntireRecords( } } -// ---------------------------------------------------------------- func (tr *TransformerUniq) transformUnlashed( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -516,7 +509,6 @@ func (tr *TransformerUniq) transformUnlashed( } } -// ---------------------------------------------------------------- func (tr *TransformerUniq) transformNumDistinctOnly( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -548,7 +540,6 @@ func (tr *TransformerUniq) transformNumDistinctOnly( } } -// ---------------------------------------------------------------- func (tr *TransformerUniq) transformWithCounts( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -598,7 +589,6 @@ func (tr *TransformerUniq) transformWithCounts( } } -// ---------------------------------------------------------------- func (tr *TransformerUniq) transformWithoutCounts( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/unspace.go b/pkg/transformers/unspace.go index 8c7933ad4..7f096b188 100644 --- a/pkg/transformers/unspace.go +++ b/pkg/transformers/unspace.go @@ -10,7 +10,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameUnspace = "unspace" var UnspaceSetup = TransformerSetup{ @@ -91,7 +90,6 @@ func transformerUnspaceParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerUnspace struct { filler string recordTransformerFunc RecordTransformerFunc diff --git a/pkg/transformers/unsparsify.go b/pkg/transformers/unsparsify.go index bf7c0afd6..fd377b414 100644 --- a/pkg/transformers/unsparsify.go +++ b/pkg/transformers/unsparsify.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameUnsparsify = "unsparsify" var UnsparsifySetup = TransformerSetup{ @@ -104,7 +103,6 @@ func transformerUnsparsifyParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerUnsparsify struct { fillerMlrval *mlrval.Mlrval recordsAndContexts []*types.RecordAndContext @@ -137,7 +135,6 @@ func NewTransformerUnsparsify( return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerUnsparsify) Transform( inrecAndContext *types.RecordAndContext, @@ -149,7 +146,6 @@ func (tr *TransformerUnsparsify) Transform( tr.recordTransformerFunc(inrecAndContext, outputRecordsAndContexts, inputDownstreamDoneChannel, outputDownstreamDoneChannel) } -// ---------------------------------------------------------------- func (tr *TransformerUnsparsify) transformNonStreaming( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext @@ -186,7 +182,6 @@ func (tr *TransformerUnsparsify) transformNonStreaming( } } -// ---------------------------------------------------------------- func (tr *TransformerUnsparsify) transformStreaming( inrecAndContext *types.RecordAndContext, outputRecordsAndContexts *[]*types.RecordAndContext, // list of *types.RecordAndContext diff --git a/pkg/transformers/utf8_to_latin1.go b/pkg/transformers/utf8_to_latin1.go index 60edeeddf..2782efedc 100644 --- a/pkg/transformers/utf8_to_latin1.go +++ b/pkg/transformers/utf8_to_latin1.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- const verbNameUTF8ToLatin1 = "utf8-to-latin1" var UTF8ToLatin1Setup = TransformerSetup{ @@ -77,7 +76,6 @@ func transformerUTF8ToLatin1ParseCLI( return transformer } -// ---------------------------------------------------------------- type TransformerUTF8ToLatin1 struct { } @@ -86,7 +84,6 @@ func NewTransformerUTF8ToLatin1() (*TransformerUTF8ToLatin1, error) { return tr, nil } -// ---------------------------------------------------------------- func (tr *TransformerUTF8ToLatin1) Transform( inrecAndContext *types.RecordAndContext, diff --git a/pkg/transformers/utils/join_bucket.go b/pkg/transformers/utils/join_bucket.go index 7195da6fa..fad612dd3 100644 --- a/pkg/transformers/utils/join_bucket.go +++ b/pkg/transformers/utils/join_bucket.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type JoinBucket struct { leftFieldValues []*mlrval.Mlrval RecordsAndContexts []*types.RecordAndContext diff --git a/pkg/transformers/utils/join_bucket_keeper.go b/pkg/transformers/utils/join_bucket_keeper.go index a3ae5c6bb..59e8b2dd7 100644 --- a/pkg/transformers/utils/join_bucket_keeper.go +++ b/pkg/transformers/utils/join_bucket_keeper.go @@ -157,7 +157,6 @@ type JoinBucketKeeper struct { state tJoinBucketKeeperState } -// ---------------------------------------------------------------- func NewJoinBucketKeeper( // TODO prepipe string, leftFileName string, diff --git a/pkg/transformers/utils/percentile_keeper.go b/pkg/transformers/utils/percentile_keeper.go index 2b2cda9ab..85cdc7fb3 100644 --- a/pkg/transformers/utils/percentile_keeper.go +++ b/pkg/transformers/utils/percentile_keeper.go @@ -22,7 +22,6 @@ type PercentileKeeper struct { var fenceInnerK = mlrval.FromFloat(1.5) var fenceOuterK = mlrval.FromFloat(3.0) -// ---------------------------------------------------------------- func NewPercentileKeeper( doInterpolatedPercentiles bool, ) *PercentileKeeper { @@ -38,7 +37,6 @@ func (keeper *PercentileKeeper) Reset() { keeper.sorted = false } -// ---------------------------------------------------------------- func (keeper *PercentileKeeper) Ingest(value *mlrval.Mlrval) { if len(keeper.data) >= cap(keeper.data) { newData := make([]*mlrval.Mlrval, len(keeper.data), 2*cap(keeper.data)) @@ -54,7 +52,6 @@ func (keeper *PercentileKeeper) Ingest(value *mlrval.Mlrval) { keeper.sorted = false } -// ---------------------------------------------------------------- func (keeper *PercentileKeeper) sortIfNecessary() { if !keeper.sorted { sort.Slice(keeper.data, func(i, j int) bool { @@ -64,7 +61,6 @@ func (keeper *PercentileKeeper) sortIfNecessary() { } } -// ---------------------------------------------------------------- func (keeper *PercentileKeeper) Emit(percentile float64) *mlrval.Mlrval { if keeper.doInterpolatedPercentiles { return keeper.EmitLinearlyInterpolated(percentile) diff --git a/pkg/transformers/utils/stats1_accumulators.go b/pkg/transformers/utils/stats1_accumulators.go index 553139b68..42b9c2bdc 100644 --- a/pkg/transformers/utils/stats1_accumulators.go +++ b/pkg/transformers/utils/stats1_accumulators.go @@ -14,14 +14,12 @@ import ( "github.com/johnkerl/miller/v6/pkg/mlrval" ) -// ---------------------------------------------------------------- type IStats1Accumulator interface { Ingest(value *mlrval.Mlrval) Emit() *mlrval.Mlrval Reset() // for merge-fields where we reset after each record instead of replace/recreate } -// ---------------------------------------------------------------- type newStats1AccumulatorFunc func() IStats1Accumulator type stats1AccumulatorInfo struct { @@ -179,7 +177,6 @@ func NewStats1AccumulatorFactory() *Stats1AccumulatorFactory { } } -// ---------------------------------------------------------------- func ListStats1Accumulators(o *os.File) { for _, info := range stats1AccumulatorInfos { fmt.Fprintf(o, " %-8s %s\n", info.name, info.description) @@ -304,7 +301,6 @@ func (factory *Stats1AccumulatorFactory) MakeAccumulator( return nil } -// ================================================================ type Stats1CountAccumulator struct { count int64 } @@ -324,7 +320,6 @@ func (acc *Stats1CountAccumulator) Reset() { acc.count = 0 } -// ================================================================ type Stats1NullCountAccumulator struct { count int64 } @@ -375,7 +370,6 @@ func (acc *Stats1DistinctCountAccumulator) Reset() { acc.distincts = lib.NewOrderedMap[int64]() } -// ---------------------------------------------------------------- type Stats1ModeAccumulator struct { // Needs to be an ordered map to guarantee Miller's semantics that // first-found breaks ties. @@ -416,7 +410,6 @@ func (acc *Stats1ModeAccumulator) Reset() { acc.countsByValue = lib.NewOrderedMap[int64]() } -// ---------------------------------------------------------------- type Stats1AntimodeAccumulator struct { // Needs to be an ordered map to guarantee Miller's semantics that // first-found breaks ties. @@ -457,7 +450,6 @@ func (acc *Stats1AntimodeAccumulator) Reset() { acc.countsByValue = lib.NewOrderedMap[int64]() } -// ---------------------------------------------------------------- type Stats1SumAccumulator struct { sum *mlrval.Mlrval } @@ -479,7 +471,6 @@ func (acc *Stats1SumAccumulator) Reset() { acc.sum = mlrval.FromInt(0) } -// ---------------------------------------------------------------- type Stats1MeanAccumulator struct { sum *mlrval.Mlrval count int64 @@ -509,7 +500,6 @@ func (acc *Stats1MeanAccumulator) Reset() { acc.count = 0 } -// ---------------------------------------------------------------- type Stats1MeanAbsDevAccumulator struct { samples []*mlrval.Mlrval } @@ -550,7 +540,6 @@ func (acc *Stats1MeanAbsDevAccumulator) Reset() { acc.samples = make([]*mlrval.Mlrval, 0, 1000) } -// ---------------------------------------------------------------- type Stats1MinAccumulator struct { min *mlrval.Mlrval } @@ -574,7 +563,6 @@ func (acc *Stats1MinAccumulator) Reset() { acc.min = mlrval.ABSENT } -// ---------------------------------------------------------------- type Stats1MaxAccumulator struct { max *mlrval.Mlrval } @@ -598,7 +586,6 @@ func (acc *Stats1MaxAccumulator) Reset() { acc.max = mlrval.ABSENT } -// ---------------------------------------------------------------- type Stats1MinLenAccumulator struct { minacc IStats1Accumulator } @@ -618,7 +605,6 @@ func (acc *Stats1MinLenAccumulator) Reset() { acc.minacc = NewStats1MinAccumulator() } -// ---------------------------------------------------------------- type Stats1MaxLenAccumulator struct { maxacc IStats1Accumulator } @@ -638,7 +624,6 @@ func (acc *Stats1MaxLenAccumulator) Reset() { acc.maxacc = NewStats1MaxAccumulator() } -// ---------------------------------------------------------------- type Stats1VarAccumulator struct { count int64 sum *mlrval.Mlrval @@ -669,7 +654,6 @@ func (acc *Stats1VarAccumulator) Reset() { acc.sum2 = mlrval.FromInt(0) } -// ---------------------------------------------------------------- type Stats1StddevAccumulator struct { count int64 sum *mlrval.Mlrval @@ -700,7 +684,6 @@ func (acc *Stats1StddevAccumulator) Reset() { acc.sum2 = mlrval.FromInt(0) } -// ---------------------------------------------------------------- type Stats1MeanEBAccumulator struct { count int64 sum *mlrval.Mlrval @@ -732,7 +715,6 @@ func (acc *Stats1MeanEBAccumulator) Reset() { acc.sum2 = mlrval.FromInt(0) } -// ---------------------------------------------------------------- type Stats1SkewnessAccumulator struct { count int64 sum *mlrval.Mlrval @@ -769,7 +751,6 @@ func (acc *Stats1SkewnessAccumulator) Reset() { acc.sum3 = mlrval.FromInt(0) } -// ---------------------------------------------------------------- type Stats1KurtosisAccumulator struct { count int64 sum *mlrval.Mlrval diff --git a/pkg/transformers/utils/stats2_accumulators.go b/pkg/transformers/utils/stats2_accumulators.go index e825af0aa..a77690420 100644 --- a/pkg/transformers/utils/stats2_accumulators.go +++ b/pkg/transformers/utils/stats2_accumulators.go @@ -13,7 +13,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/mlrval" ) -// ---------------------------------------------------------------- type IStats2Accumulator interface { Ingest( x float64, @@ -84,7 +83,6 @@ var stats2AccumulatorInfos []stats2AccumulatorInfo = []stats2AccumulatorInfo{ }, } -// ---------------------------------------------------------------- type Stats2AccumulatorFactory struct { } @@ -124,7 +122,6 @@ func (factory *Stats2AccumulatorFactory) Make( return nil } -// ================================================================ type Stats2LinRegOLSAccumulator struct { count int64 sumx float64 @@ -216,7 +213,6 @@ func (acc *Stats2LinRegOLSAccumulator) Fit( } } -// ================================================================ const LOGIREG_DVECTOR_INITIAL_SIZE = 16 type Stats2LogiRegAccumulator struct { @@ -426,7 +422,6 @@ type Stats2CorrCovAccumulator struct { q float64 } -// ---------------------------------------------------------------- func NewStats2CorrCovAccumulator( valueFieldName1 string, valueFieldName2 string, @@ -626,7 +621,6 @@ func (acc *Stats2CorrCovAccumulator) Fit( } } -// ================================================================ func NewStats2CorrAccumulator( valueFieldName1 string, valueFieldName2 string, diff --git a/pkg/transformers/utils/top_keeper.go b/pkg/transformers/utils/top_keeper.go index 4e59783d0..4e74ee23a 100644 --- a/pkg/transformers/utils/top_keeper.go +++ b/pkg/transformers/utils/top_keeper.go @@ -9,7 +9,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/types" ) -// ---------------------------------------------------------------- type TopKeeper struct { TopValues []*mlrval.Mlrval TopRecordsAndContexts []*types.RecordAndContext @@ -18,7 +17,6 @@ type TopKeeper struct { bsearchFunc mlrval.BsearchMlrvalArrayFunc } -// ---------------------------------------------------------------- func NewTopKeeper(capacity int64, doMax bool) *TopKeeper { keeper := &TopKeeper{ TopValues: make([]*mlrval.Mlrval, capacity), diff --git a/pkg/types/context.go b/pkg/types/context.go index ce50aa69a..5a12264e6 100644 --- a/pkg/types/context.go +++ b/pkg/types/context.go @@ -88,7 +88,6 @@ func NewEndOfStreamMarkerList(context *Context) []*RecordAndContext { return recordsAndContexts } -// ---------------------------------------------------------------- type Context struct { FILENAME string FILENUM int64 diff --git a/pkg/types/mlrval_typing.go b/pkg/types/mlrval_typing.go index 66a7799f1..67b914d33 100644 --- a/pkg/types/mlrval_typing.go +++ b/pkg/types/mlrval_typing.go @@ -11,7 +11,6 @@ import ( "github.com/johnkerl/miller/v6/pkg/mlrval" ) -// ---------------------------------------------------------------- type TypeGatedMlrvalName struct { Name string TypeName string @@ -45,7 +44,6 @@ func (tname *TypeGatedMlrvalName) Check(value *mlrval.Mlrval) error { } } -// ---------------------------------------------------------------- type TypeGatedMlrvalVariable struct { typeGatedMlrvalName *TypeGatedMlrvalName value *mlrval.Mlrval diff --git a/scripts/early-multi-language-timings/catgo.go b/scripts/early-multi-language-timings/catgo.go index 6521c3a99..ff32200ce 100644 --- a/scripts/early-multi-language-timings/catgo.go +++ b/scripts/early-multi-language-timings/catgo.go @@ -7,7 +7,6 @@ import ( "os" ) -// ---------------------------------------------------------------- func main() { args := os.Args[1:] @@ -26,7 +25,6 @@ func main() { } } -// ---------------------------------------------------------------- func handle(fileName string) (ok bool) { inputStream := os.Stdin if fileName != "-" { diff --git a/scripts/early-multi-language-timings/catgo2.go b/scripts/early-multi-language-timings/catgo2.go index db3f8f7f8..a7c933c0e 100644 --- a/scripts/early-multi-language-timings/catgo2.go +++ b/scripts/early-multi-language-timings/catgo2.go @@ -7,7 +7,6 @@ import ( "os" ) -// ---------------------------------------------------------------- func main() { args := os.Args[1:] @@ -26,7 +25,6 @@ func main() { } } -// ---------------------------------------------------------------- func handle(fileName string) (ok bool) { inputStream := os.Stdin if fileName != "-" { diff --git a/scripts/early-multi-language-timings/cutgo.go b/scripts/early-multi-language-timings/cutgo.go index b5985c8db..0d0b06179 100644 --- a/scripts/early-multi-language-timings/cutgo.go +++ b/scripts/early-multi-language-timings/cutgo.go @@ -9,7 +9,6 @@ import ( "strings" ) -// ---------------------------------------------------------------- func main() { includeFields := strings.Split(os.Args[1], ",") filenames := os.Args[2:] @@ -29,7 +28,6 @@ func main() { } } -// ---------------------------------------------------------------- func handle(fileName string, includeFields []string) (ok bool) { inputStream := os.Stdin if fileName != "-" {