From 268a96d0025c66568ee2429fc1928c804801ee5c Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 10 Sep 2023 17:15:13 -0400 Subject: [PATCH] Export library code in `pkg/` (#1391) * Export library code in `pkg/` * new doc page --- Makefile | 22 +- README-dev.md | 50 ++--- README.md | 2 +- cmd/experiments/colors/main.go | 2 +- cmd/mlr/main.go | 2 +- cmd/scan/main.go | 2 +- cmd/sizes/main.go | 2 +- docs/mkdocs.yml | 1 + docs/src/build.md | 2 +- docs/src/build.md.in | 2 +- docs/src/how-to-release.md | 4 +- docs/src/how-to-release.md.in | 4 +- docs/src/manpage.md | 2 +- docs/src/manpage.txt | 2 +- docs/src/miller-as-library.md | 202 ++++++++++++++++++ docs/src/miller-as-library.md.in | 54 +++++ docs/src/miller-as-library/main1.go | 15 ++ docs/src/miller-as-library/main2.go | 111 ++++++++++ internal/pkg/cli/README.md | 4 - man/manpage.txt | 2 +- man/mlr.1 | 4 +- {internal/pkg => pkg}/README.md | 0 {internal/pkg => pkg}/auxents/auxents.go | 0 {internal/pkg => pkg}/auxents/doc.go | 0 {internal/pkg => pkg}/auxents/hex.go | 0 {internal/pkg => pkg}/auxents/lecat.go | 0 {internal/pkg => pkg}/auxents/termcvt.go | 0 {internal/pkg => pkg}/auxents/unhex.go | 0 {internal/pkg => pkg}/bifs/arithmetic.go | 4 +- {internal/pkg => pkg}/bifs/arithmetic_test.go | 2 +- {internal/pkg => pkg}/bifs/base.go | 6 +- {internal/pkg => pkg}/bifs/bits.go | 2 +- {internal/pkg => pkg}/bifs/bits_test.go | 2 +- {internal/pkg => pkg}/bifs/booleans.go | 2 +- {internal/pkg => pkg}/bifs/cmp.go | 4 +- {internal/pkg => pkg}/bifs/collections.go | 4 +- .../pkg => pkg}/bifs/collections_test.go | 2 +- {internal/pkg => pkg}/bifs/datetime.go | 6 +- {internal/pkg => pkg}/bifs/hashing.go | 2 +- {internal/pkg => pkg}/bifs/hashing_test.go | 2 +- {internal/pkg => pkg}/bifs/mathlib.go | 4 +- {internal/pkg => pkg}/bifs/percentiles.go | 2 +- {internal/pkg => pkg}/bifs/random.go | 4 +- {internal/pkg => pkg}/bifs/regex.go | 4 +- {internal/pkg => pkg}/bifs/relative_time.go | 2 +- {internal/pkg => pkg}/bifs/stats.go | 4 +- {internal/pkg => pkg}/bifs/stats_test.go | 2 +- {internal/pkg => pkg}/bifs/strings.go | 4 +- {internal/pkg => pkg}/bifs/system.go | 6 +- {internal/pkg => pkg}/bifs/types.go | 6 +- pkg/cli/README.md | 4 + {internal/pkg => pkg}/cli/doc.go | 0 {internal/pkg => pkg}/cli/flag_types.go | 6 +- .../pkg => pkg}/cli/flatten_unflatten.go | 0 {internal/pkg => pkg}/cli/mlrcli_util.go | 0 {internal/pkg => pkg}/cli/option_parse.go | 6 +- {internal/pkg => pkg}/cli/option_types.go | 2 +- {internal/pkg => pkg}/cli/separators.go | 0 {internal/pkg => pkg}/cli/verb_utils.go | 2 +- {internal/pkg => pkg}/climain/README.md | 4 +- {internal/pkg => pkg}/climain/doc.go | 0 {internal/pkg => pkg}/climain/mlrcli_mlrrc.go | 2 +- {internal/pkg => pkg}/climain/mlrcli_parse.go | 14 +- .../pkg => pkg}/climain/mlrcli_shebang.go | 2 +- {internal/pkg => pkg}/colorizer/README.md | 2 +- {internal/pkg => pkg}/colorizer/colorizer.go | 0 {internal/pkg => pkg}/colorizer/doc.go | 0 {internal/pkg => pkg}/dsl/README.md | 2 +- {internal/pkg => pkg}/dsl/ast_build.go | 4 +- {internal/pkg => pkg}/dsl/ast_print.go | 0 {internal/pkg => pkg}/dsl/ast_types.go | 2 +- {internal/pkg => pkg}/dsl/cst/README.md | 2 +- {internal/pkg => pkg}/dsl/cst/assignments.go | 6 +- {internal/pkg => pkg}/dsl/cst/block_exit.go | 6 +- {internal/pkg => pkg}/dsl/cst/blocks.go | 6 +- .../dsl/cst/builtin_function_manager.go | 6 +- .../pkg => pkg}/dsl/cst/builtin_functions.go | 10 +- {internal/pkg => pkg}/dsl/cst/collections.go | 10 +- {internal/pkg => pkg}/dsl/cst/cond.go | 10 +- {internal/pkg => pkg}/dsl/cst/doc.go | 0 {internal/pkg => pkg}/dsl/cst/dump.go | 10 +- {internal/pkg => pkg}/dsl/cst/emit1.go | 8 +- {internal/pkg => pkg}/dsl/cst/emit_emitp.go | 14 +- {internal/pkg => pkg}/dsl/cst/emitf.go | 12 +- {internal/pkg => pkg}/dsl/cst/env.go | 8 +- {internal/pkg => pkg}/dsl/cst/evaluable.go | 8 +- {internal/pkg => pkg}/dsl/cst/filter.go | 6 +- {internal/pkg => pkg}/dsl/cst/for.go | 10 +- {internal/pkg => pkg}/dsl/cst/functions.go | 4 +- {internal/pkg => pkg}/dsl/cst/hofs.go | 8 +- {internal/pkg => pkg}/dsl/cst/if.go | 10 +- .../pkg => pkg}/dsl/cst/keyword_usage.go | 4 +- {internal/pkg => pkg}/dsl/cst/leaves.go | 8 +- {internal/pkg => pkg}/dsl/cst/lvalues.go | 8 +- {internal/pkg => pkg}/dsl/cst/print.go | 10 +- {internal/pkg => pkg}/dsl/cst/root.go | 14 +- {internal/pkg => pkg}/dsl/cst/signature.go | 2 +- {internal/pkg => pkg}/dsl/cst/statements.go | 2 +- {internal/pkg => pkg}/dsl/cst/subroutines.go | 4 +- {internal/pkg => pkg}/dsl/cst/tee.go | 12 +- {internal/pkg => pkg}/dsl/cst/types.go | 8 +- {internal/pkg => pkg}/dsl/cst/udf.go | 10 +- {internal/pkg => pkg}/dsl/cst/uds.go | 10 +- {internal/pkg => pkg}/dsl/cst/validate.go | 4 +- {internal/pkg => pkg}/dsl/cst/warn.go | 4 +- {internal/pkg => pkg}/dsl/cst/while.go | 8 +- {internal/pkg => pkg}/dsl/doc.go | 0 {internal/pkg => pkg}/dsl/token.go | 2 +- {internal/pkg => pkg}/entrypoint/README.md | 0 {internal/pkg => pkg}/entrypoint/doc.go | 0 .../pkg => pkg}/entrypoint/entrypoint.go | 14 +- {internal/pkg => pkg}/go-csv/LICENSE | 0 {internal/pkg => pkg}/go-csv/README.md | 0 {internal/pkg => pkg}/go-csv/csv_reader.go | 0 {internal/pkg => pkg}/go-csv/csv_writer.go | 0 {internal/pkg => pkg}/input/README.md | 0 {internal/pkg => pkg}/input/doc.go | 0 .../pkg => pkg}/input/pseudo_reader_gen.go | 8 +- {internal/pkg => pkg}/input/record_reader.go | 6 +- .../input/record_reader_benchmark_test.go | 4 +- .../pkg => pkg}/input/record_reader_csv.go | 10 +- .../input/record_reader_csvlite.go | 8 +- .../input/record_reader_dkvp_nidx.go | 8 +- .../input/record_reader_dkvp_test.go | 2 +- .../input/record_reader_factory.go | 2 +- .../pkg => pkg}/input/record_reader_json.go | 8 +- .../pkg => pkg}/input/record_reader_tsv.go | 8 +- .../pkg => pkg}/input/record_reader_xtab.go | 8 +- {internal/pkg => pkg}/lib/README.md | 0 {internal/pkg => pkg}/lib/doc.go | 0 {internal/pkg => pkg}/lib/docurl.go | 0 {internal/pkg => pkg}/lib/file_readers.go | 2 +- {internal/pkg => pkg}/lib/getoptify.go | 0 {internal/pkg => pkg}/lib/halfpipe.go | 2 +- {internal/pkg => pkg}/lib/latin1.go | 0 {internal/pkg => pkg}/lib/latin1_test.go | 0 {internal/pkg => pkg}/lib/logger.go | 0 {internal/pkg => pkg}/lib/mlrmath.go | 0 {internal/pkg => pkg}/lib/ordered_map.go | 0 {internal/pkg => pkg}/lib/paragraph.go | 0 {internal/pkg => pkg}/lib/rand.go | 0 {internal/pkg => pkg}/lib/readfiles.go | 2 +- {internal/pkg => pkg}/lib/regex.go | 0 {internal/pkg => pkg}/lib/regex_test.go | 0 {internal/pkg => pkg}/lib/stats.go | 0 {internal/pkg => pkg}/lib/time.go | 0 {internal/pkg => pkg}/lib/time_test.go | 0 {internal/pkg => pkg}/lib/tsv_codec.go | 0 {internal/pkg => pkg}/lib/tsv_codec_test.go | 0 {internal/pkg => pkg}/lib/unbackslash.go | 0 {internal/pkg => pkg}/lib/unbackslash_test.go | 0 {internal/pkg => pkg}/lib/util.go | 0 {internal/pkg => pkg}/mlrval/mlrmap.go | 0 .../pkg => pkg}/mlrval/mlrmap_accessors.go | 2 +- .../mlrval/mlrmap_accessors_test.go | 0 .../mlrval/mlrmap_flatten_unflatten.go | 2 +- {internal/pkg => pkg}/mlrval/mlrmap_json.go | 4 +- .../pkg => pkg}/mlrval/mlrmap_new_test.go | 0 {internal/pkg => pkg}/mlrval/mlrmap_print.go | 0 .../pkg => pkg}/mlrval/mlrval_accessors.go | 2 +- .../mlrval/mlrval_benchmark_test.go | 2 +- {internal/pkg => pkg}/mlrval/mlrval_cmp.go | 2 +- .../pkg => pkg}/mlrval/mlrval_cmp_test.go | 0 .../pkg => pkg}/mlrval/mlrval_collections.go | 2 +- .../pkg => pkg}/mlrval/mlrval_constants.go | 0 {internal/pkg => pkg}/mlrval/mlrval_copy.go | 0 {internal/pkg => pkg}/mlrval/mlrval_format.go | 0 .../pkg => pkg}/mlrval/mlrval_format_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_get.go | 2 +- .../pkg => pkg}/mlrval/mlrval_get_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_infer.go | 2 +- .../pkg => pkg}/mlrval/mlrval_infer_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_is.go | 2 +- .../pkg => pkg}/mlrval/mlrval_is_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_json.go | 4 +- {internal/pkg => pkg}/mlrval/mlrval_new.go | 4 +- .../pkg => pkg}/mlrval/mlrval_new_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_output.go | 0 .../pkg => pkg}/mlrval/mlrval_output_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_sort.go | 0 .../pkg => pkg}/mlrval/mlrval_sort_test.go | 0 {internal/pkg => pkg}/mlrval/mlrval_type.go | 0 .../pkg => pkg}/mlrval/mlrval_type_test.go | 0 {internal/pkg => pkg}/output/README.md | 0 .../pkg => pkg}/output/channel_writer.go | 4 +- {internal/pkg => pkg}/output/doc.go | 0 .../output/file_output_handlers.go | 6 +- {internal/pkg => pkg}/output/record_writer.go | 2 +- .../pkg => pkg}/output/record_writer_csv.go | 6 +- .../output/record_writer_csv_colorizer.go | 2 +- .../output/record_writer_csvlite.go | 6 +- .../pkg => pkg}/output/record_writer_dkvp.go | 6 +- .../output/record_writer_factory.go | 2 +- .../pkg => pkg}/output/record_writer_json.go | 4 +- .../output/record_writer_markdown.go | 6 +- .../pkg => pkg}/output/record_writer_nidx.go | 4 +- .../output/record_writer_pprint.go | 6 +- .../pkg => pkg}/output/record_writer_tsv.go | 8 +- .../pkg => pkg}/output/record_writer_xtab.go | 6 +- {internal/pkg => pkg}/parsing/README.md | 4 +- {internal/pkg => pkg}/parsing/doc.go | 0 .../pkg => pkg}/parsing/errors.go.template | 6 +- {internal/pkg => pkg}/parsing/errors/doc.go | 2 +- .../pkg => pkg}/parsing/errors/errors.go | 6 +- {internal/pkg => pkg}/parsing/lexer/acttab.go | 2 +- {internal/pkg => pkg}/parsing/lexer/doc.go | 2 +- {internal/pkg => pkg}/parsing/lexer/lexer.go | 2 +- .../parsing/lexer/transitiontable.go | 0 {internal/pkg => pkg}/parsing/mlr.bnf | 4 +- .../pkg => pkg}/parsing/parser/action.go | 0 .../pkg => pkg}/parsing/parser/actiontable.go | 0 .../pkg => pkg}/parsing/parser/context.go | 0 {internal/pkg => pkg}/parsing/parser/doc.go | 2 +- .../pkg => pkg}/parsing/parser/gototable.go | 0 .../pkg => pkg}/parsing/parser/parser.go | 4 +- .../parsing/parser/productionstable.go | 2 +- .../pkg => pkg}/parsing/token/context.go | 0 {internal/pkg => pkg}/parsing/token/doc.go | 2 +- {internal/pkg => pkg}/parsing/token/token.go | 0 {internal/pkg => pkg}/parsing/util/doc.go | 2 +- {internal/pkg => pkg}/parsing/util/litconv.go | 0 {internal/pkg => pkg}/parsing/util/rune.go | 0 .../pkg => pkg}/pbnjay-strptime/README.md | 0 .../pkg => pkg}/pbnjay-strptime/strptime.go | 0 .../pbnjay-strptime/strptime_test.go | 0 {internal/pkg => pkg}/platform/README.md | 0 .../pkg => pkg}/platform/diff_notwindows.go | 0 .../pkg => pkg}/platform/diff_windows.go | 0 {internal/pkg => pkg}/platform/doc.go | 0 .../platform/getargs_notwindows.go | 0 .../pkg => pkg}/platform/getargs_windows.go | 0 .../platform/shellrun_notwindows.go | 0 .../pkg => pkg}/platform/shellrun_windows.go | 0 .../platform/terminal_notwindows.go | 0 .../pkg => pkg}/platform/terminal_windows.go | 0 {internal/pkg => pkg}/runtime/README.md | 0 {internal/pkg => pkg}/runtime/doc.go | 0 {internal/pkg => pkg}/runtime/stack.go | 6 +- {internal/pkg => pkg}/runtime/state.go | 8 +- {internal/pkg => pkg}/scan/digits.go | 0 {internal/pkg => pkg}/scan/digits_test.go | 0 {internal/pkg => pkg}/scan/doc.go | 0 {internal/pkg => pkg}/scan/find.go | 0 .../pkg => pkg}/scan/find_benchmark_test.go | 2 +- {internal/pkg => pkg}/scan/find_test.go | 0 {internal/pkg => pkg}/scan/type.go | 0 {internal/pkg => pkg}/scan/type_test.go | 0 {internal/pkg => pkg}/stream/README.md | 0 {internal/pkg => pkg}/stream/doc.go | 0 {internal/pkg => pkg}/stream/stream.go | 10 +- {internal/pkg => pkg}/terminals/doc.go | 0 {internal/pkg => pkg}/terminals/help/doc.go | 0 {internal/pkg => pkg}/terminals/help/entry.go | 14 +- .../pkg => pkg}/terminals/regtest/README.md | 0 .../pkg => pkg}/terminals/regtest/doc.go | 0 .../pkg => pkg}/terminals/regtest/entry.go | 0 .../pkg => pkg}/terminals/regtest/invoker.go | 4 +- .../terminals/regtest/regtester.go | 4 +- .../pkg => pkg}/terminals/repl/README.md | 0 {internal/pkg => pkg}/terminals/repl/doc.go | 0 {internal/pkg => pkg}/terminals/repl/dsl.go | 6 +- {internal/pkg => pkg}/terminals/repl/entry.go | 2 +- .../pkg => pkg}/terminals/repl/prompt.go | 6 +- .../pkg => pkg}/terminals/repl/session.go | 16 +- {internal/pkg => pkg}/terminals/repl/types.go | 10 +- {internal/pkg => pkg}/terminals/repl/verbs.go | 12 +- {internal/pkg => pkg}/terminals/terminals.go | 8 +- {internal/pkg => pkg}/transformers/README.md | 0 .../transformers/aaa_chain_transformer.go | 4 +- .../transformers/aaa_record_transformer.go | 4 +- .../transformers/aaa_transformer_table.go | 4 +- {internal/pkg => pkg}/transformers/altkv.go | 6 +- {internal/pkg => pkg}/transformers/bar.go | 6 +- .../pkg => pkg}/transformers/bootstrap.go | 6 +- {internal/pkg => pkg}/transformers/case.go | 8 +- {internal/pkg => pkg}/transformers/cat.go | 6 +- {internal/pkg => pkg}/transformers/check.go | 4 +- .../transformers/clean_whitespace.go | 8 +- {internal/pkg => pkg}/transformers/count.go | 8 +- .../pkg => pkg}/transformers/count_similar.go | 8 +- {internal/pkg => pkg}/transformers/cut.go | 8 +- .../pkg => pkg}/transformers/decimate.go | 4 +- {internal/pkg => pkg}/transformers/doc.go | 0 .../pkg => pkg}/transformers/fill_down.go | 6 +- .../pkg => pkg}/transformers/fill_empty.go | 6 +- {internal/pkg => pkg}/transformers/flatten.go | 6 +- .../pkg => pkg}/transformers/format_values.go | 6 +- .../pkg => pkg}/transformers/fraction.go | 10 +- {internal/pkg => pkg}/transformers/gap.go | 6 +- {internal/pkg => pkg}/transformers/grep.go | 4 +- .../pkg => pkg}/transformers/group_by.go | 6 +- .../pkg => pkg}/transformers/group_like.go | 6 +- {internal/pkg => pkg}/transformers/gsub.go | 8 +- .../pkg => pkg}/transformers/having_fields.go | 6 +- {internal/pkg => pkg}/transformers/head.go | 4 +- .../pkg => pkg}/transformers/histogram.go | 8 +- {internal/pkg => pkg}/transformers/join.go | 12 +- .../pkg => pkg}/transformers/json_parse.go | 6 +- .../transformers/json_stringify.go | 8 +- {internal/pkg => pkg}/transformers/label.go | 6 +- .../transformers/latin1_to_utf8.go | 8 +- .../pkg => pkg}/transformers/merge_fields.go | 8 +- .../transformers/most_or_least_frequent.go | 8 +- {internal/pkg => pkg}/transformers/nest.go | 8 +- {internal/pkg => pkg}/transformers/nothing.go | 4 +- .../pkg => pkg}/transformers/put_or_filter.go | 14 +- .../pkg => pkg}/transformers/regularize.go | 8 +- .../transformers/remove_empty_columns.go | 6 +- {internal/pkg => pkg}/transformers/rename.go | 6 +- {internal/pkg => pkg}/transformers/reorder.go | 8 +- {internal/pkg => pkg}/transformers/repeat.go | 4 +- {internal/pkg => pkg}/transformers/reshape.go | 8 +- {internal/pkg => pkg}/transformers/sample.go | 6 +- {internal/pkg => pkg}/transformers/sec2gmt.go | 8 +- .../pkg => pkg}/transformers/sec2gmtdate.go | 8 +- {internal/pkg => pkg}/transformers/seqgen.go | 8 +- {internal/pkg => pkg}/transformers/shuffle.go | 6 +- .../transformers/skip_trivial_records.go | 4 +- {internal/pkg => pkg}/transformers/sort.go | 8 +- .../transformers/sort_within_records.go | 4 +- {internal/pkg => pkg}/transformers/split.go | 8 +- {internal/pkg => pkg}/transformers/ssub.go | 8 +- {internal/pkg => pkg}/transformers/stats1.go | 10 +- {internal/pkg => pkg}/transformers/stats2.go | 10 +- {internal/pkg => pkg}/transformers/step.go | 12 +- {internal/pkg => pkg}/transformers/sub.go | 8 +- {internal/pkg => pkg}/transformers/summary.go | 10 +- {internal/pkg => pkg}/transformers/tac.go | 4 +- {internal/pkg => pkg}/transformers/tail.go | 6 +- {internal/pkg => pkg}/transformers/tee.go | 6 +- .../pkg => pkg}/transformers/template.go | 8 +- {internal/pkg => pkg}/transformers/top.go | 10 +- .../pkg => pkg}/transformers/unflatten.go | 6 +- {internal/pkg => pkg}/transformers/uniq.go | 8 +- {internal/pkg => pkg}/transformers/unspace.go | 6 +- .../pkg => pkg}/transformers/unsparsify.go | 8 +- .../transformers/utf8_to_latin1.go | 8 +- .../pkg => pkg}/transformers/utils/README.md | 0 .../pkg => pkg}/transformers/utils/doc.go | 0 .../transformers/utils/join_bucket.go | 2 +- .../transformers/utils/join_bucket_keeper.go | 10 +- .../transformers/utils/percentile_keeper.go | 4 +- .../transformers/utils/stats1_accumulators.go | 6 +- .../transformers/utils/stats2_accumulators.go | 4 +- .../transformers/utils/top_keeper.go | 4 +- .../transformers/utils/window_keeper.go | 2 +- .../transformers/utils/window_keeper_test.go | 0 {internal/pkg => pkg}/types/README.md | 0 {internal/pkg => pkg}/types/context.go | 2 +- {internal/pkg => pkg}/types/doc.go | 0 .../pkg => pkg}/types/indexed-lvalues.md | 0 {internal/pkg => pkg}/types/mlrval_typing.go | 2 +- {internal/pkg => pkg}/version/doc.go | 0 {internal/pkg => pkg}/version/version.go | 0 regression_test.go | 4 +- scripts/mcountlines | 8 +- todo.txt | 2 +- tools/build-dsl | 22 +- 358 files changed, 1076 insertions(+), 693 deletions(-) create mode 100644 docs/src/miller-as-library.md create mode 100644 docs/src/miller-as-library.md.in create mode 100644 docs/src/miller-as-library/main1.go create mode 100644 docs/src/miller-as-library/main2.go delete mode 100644 internal/pkg/cli/README.md rename {internal/pkg => pkg}/README.md (100%) rename {internal/pkg => pkg}/auxents/auxents.go (100%) rename {internal/pkg => pkg}/auxents/doc.go (100%) rename {internal/pkg => pkg}/auxents/hex.go (100%) rename {internal/pkg => pkg}/auxents/lecat.go (100%) rename {internal/pkg => pkg}/auxents/termcvt.go (100%) rename {internal/pkg => pkg}/auxents/unhex.go (100%) rename {internal/pkg => pkg}/bifs/arithmetic.go (99%) rename {internal/pkg => pkg}/bifs/arithmetic_test.go (98%) rename {internal/pkg => pkg}/bifs/base.go (98%) rename {internal/pkg => pkg}/bifs/bits.go (99%) rename {internal/pkg => pkg}/bifs/bits_test.go (87%) rename {internal/pkg => pkg}/bifs/booleans.go (95%) rename {internal/pkg => pkg}/bifs/cmp.go (99%) rename {internal/pkg => pkg}/bifs/collections.go (99%) rename {internal/pkg => pkg}/bifs/collections_test.go (98%) rename {internal/pkg => pkg}/bifs/datetime.go (99%) rename {internal/pkg => pkg}/bifs/hashing.go (95%) rename {internal/pkg => pkg}/bifs/hashing_test.go (91%) rename {internal/pkg => pkg}/bifs/mathlib.go (99%) rename {internal/pkg => pkg}/bifs/percentiles.go (99%) rename {internal/pkg => pkg}/bifs/random.go (94%) rename {internal/pkg => pkg}/bifs/regex.go (98%) rename {internal/pkg => pkg}/bifs/relative_time.go (99%) rename {internal/pkg => pkg}/bifs/stats.go (99%) rename {internal/pkg => pkg}/bifs/stats_test.go (99%) rename {internal/pkg => pkg}/bifs/strings.go (99%) rename {internal/pkg => pkg}/bifs/system.go (93%) rename {internal/pkg => pkg}/bifs/types.go (98%) create mode 100644 pkg/cli/README.md rename {internal/pkg => pkg}/cli/doc.go (100%) rename {internal/pkg => pkg}/cli/flag_types.go (99%) rename {internal/pkg => pkg}/cli/flatten_unflatten.go (100%) rename {internal/pkg => pkg}/cli/mlrcli_util.go (100%) rename {internal/pkg => pkg}/cli/option_parse.go (99%) rename {internal/pkg => pkg}/cli/option_types.go (99%) rename {internal/pkg => pkg}/cli/separators.go (100%) rename {internal/pkg => pkg}/cli/verb_utils.go (98%) rename {internal/pkg => pkg}/climain/README.md (51%) rename {internal/pkg => pkg}/climain/doc.go (100%) rename {internal/pkg => pkg}/climain/mlrcli_mlrrc.go (98%) rename {internal/pkg => pkg}/climain/mlrcli_parse.go (97%) rename {internal/pkg => pkg}/climain/mlrcli_shebang.go (98%) rename {internal/pkg => pkg}/colorizer/README.md (58%) rename {internal/pkg => pkg}/colorizer/colorizer.go (100%) rename {internal/pkg => pkg}/colorizer/doc.go (100%) rename {internal/pkg => pkg}/dsl/README.md (94%) rename {internal/pkg => pkg}/dsl/ast_build.go (98%) rename {internal/pkg => pkg}/dsl/ast_print.go (100%) rename {internal/pkg => pkg}/dsl/ast_types.go (99%) rename {internal/pkg => pkg}/dsl/cst/README.md (93%) rename {internal/pkg => pkg}/dsl/cst/assignments.go (94%) rename {internal/pkg => pkg}/dsl/cst/block_exit.go (94%) rename {internal/pkg => pkg}/dsl/cst/blocks.go (96%) rename {internal/pkg => pkg}/dsl/cst/builtin_function_manager.go (99%) rename {internal/pkg => pkg}/dsl/cst/builtin_functions.go (99%) rename {internal/pkg => pkg}/dsl/cst/collections.go (98%) rename {internal/pkg => pkg}/dsl/cst/cond.go (88%) rename {internal/pkg => pkg}/dsl/cst/doc.go (100%) rename {internal/pkg => pkg}/dsl/cst/dump.go (96%) rename {internal/pkg => pkg}/dsl/cst/emit1.go (92%) rename {internal/pkg => pkg}/dsl/cst/emit_emitp.go (98%) rename {internal/pkg => pkg}/dsl/cst/emitf.go (95%) rename {internal/pkg => pkg}/dsl/cst/env.go (87%) rename {internal/pkg => pkg}/dsl/cst/evaluable.go (96%) rename {internal/pkg => pkg}/dsl/cst/filter.go (95%) rename {internal/pkg => pkg}/dsl/cst/for.go (99%) rename {internal/pkg => pkg}/dsl/cst/functions.go (97%) rename {internal/pkg => pkg}/dsl/cst/hofs.go (99%) rename {internal/pkg => pkg}/dsl/cst/if.go (94%) rename {internal/pkg => pkg}/dsl/cst/keyword_usage.go (99%) rename {internal/pkg => pkg}/dsl/cst/leaves.go (98%) rename {internal/pkg => pkg}/dsl/cst/lvalues.go (99%) rename {internal/pkg => pkg}/dsl/cst/print.go (97%) rename {internal/pkg => pkg}/dsl/cst/root.go (97%) rename {internal/pkg => pkg}/dsl/cst/signature.go (95%) rename {internal/pkg => pkg}/dsl/cst/statements.go (98%) rename {internal/pkg => pkg}/dsl/cst/subroutines.go (96%) rename {internal/pkg => pkg}/dsl/cst/tee.go (94%) rename {internal/pkg => pkg}/dsl/cst/types.go (95%) rename {internal/pkg => pkg}/dsl/cst/udf.go (98%) rename {internal/pkg => pkg}/dsl/cst/uds.go (97%) rename {internal/pkg => pkg}/dsl/cst/validate.go (98%) rename {internal/pkg => pkg}/dsl/cst/warn.go (98%) rename {internal/pkg => pkg}/dsl/cst/while.go (95%) rename {internal/pkg => pkg}/dsl/doc.go (100%) rename {internal/pkg => pkg}/dsl/token.go (87%) rename {internal/pkg => pkg}/entrypoint/README.md (100%) rename {internal/pkg => pkg}/entrypoint/doc.go (100%) rename {internal/pkg => pkg}/entrypoint/entrypoint.go (94%) rename {internal/pkg => pkg}/go-csv/LICENSE (100%) rename {internal/pkg => pkg}/go-csv/README.md (100%) rename {internal/pkg => pkg}/go-csv/csv_reader.go (100%) rename {internal/pkg => pkg}/go-csv/csv_writer.go (100%) rename {internal/pkg => pkg}/input/README.md (100%) rename {internal/pkg => pkg}/input/doc.go (100%) rename {internal/pkg => pkg}/input/pseudo_reader_gen.go (96%) rename {internal/pkg => pkg}/input/record_reader.go (96%) rename {internal/pkg => pkg}/input/record_reader_benchmark_test.go (92%) rename {internal/pkg => pkg}/input/record_reader_csv.go (97%) rename {internal/pkg => pkg}/input/record_reader_csvlite.go (98%) rename {internal/pkg => pkg}/input/record_reader_dkvp_nidx.go (96%) rename {internal/pkg => pkg}/input/record_reader_dkvp_test.go (97%) rename {internal/pkg => pkg}/input/record_reader_factory.go (95%) rename {internal/pkg => pkg}/input/record_reader_json.go (97%) rename {internal/pkg => pkg}/input/record_reader_tsv.go (98%) rename {internal/pkg => pkg}/input/record_reader_xtab.go (98%) rename {internal/pkg => pkg}/lib/README.md (100%) rename {internal/pkg => pkg}/lib/doc.go (100%) rename {internal/pkg => pkg}/lib/docurl.go (100%) rename {internal/pkg => pkg}/lib/file_readers.go (99%) rename {internal/pkg => pkg}/lib/getoptify.go (100%) rename {internal/pkg => pkg}/lib/halfpipe.go (97%) rename {internal/pkg => pkg}/lib/latin1.go (100%) rename {internal/pkg => pkg}/lib/latin1_test.go (100%) rename {internal/pkg => pkg}/lib/logger.go (100%) rename {internal/pkg => pkg}/lib/mlrmath.go (100%) rename {internal/pkg => pkg}/lib/ordered_map.go (100%) rename {internal/pkg => pkg}/lib/paragraph.go (100%) rename {internal/pkg => pkg}/lib/rand.go (100%) rename {internal/pkg => pkg}/lib/readfiles.go (97%) rename {internal/pkg => pkg}/lib/regex.go (100%) rename {internal/pkg => pkg}/lib/regex_test.go (100%) rename {internal/pkg => pkg}/lib/stats.go (100%) rename {internal/pkg => pkg}/lib/time.go (100%) rename {internal/pkg => pkg}/lib/time_test.go (100%) rename {internal/pkg => pkg}/lib/tsv_codec.go (100%) rename {internal/pkg => pkg}/lib/tsv_codec_test.go (100%) rename {internal/pkg => pkg}/lib/unbackslash.go (100%) rename {internal/pkg => pkg}/lib/unbackslash_test.go (100%) rename {internal/pkg => pkg}/lib/util.go (100%) rename {internal/pkg => pkg}/mlrval/mlrmap.go (100%) rename {internal/pkg => pkg}/mlrval/mlrmap_accessors.go (99%) rename {internal/pkg => pkg}/mlrval/mlrmap_accessors_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrmap_flatten_unflatten.go (99%) rename {internal/pkg => pkg}/mlrval/mlrmap_json.go (98%) rename {internal/pkg => pkg}/mlrval/mlrmap_new_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrmap_print.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_accessors.go (98%) rename {internal/pkg => pkg}/mlrval/mlrval_benchmark_test.go (86%) rename {internal/pkg => pkg}/mlrval/mlrval_cmp.go (99%) rename {internal/pkg => pkg}/mlrval/mlrval_cmp_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_collections.go (99%) rename {internal/pkg => pkg}/mlrval/mlrval_constants.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_copy.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_format.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_format_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_get.go (98%) rename {internal/pkg => pkg}/mlrval/mlrval_get_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_infer.go (99%) rename {internal/pkg => pkg}/mlrval/mlrval_infer_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_is.go (98%) rename {internal/pkg => pkg}/mlrval/mlrval_is_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_json.go (99%) rename {internal/pkg => pkg}/mlrval/mlrval_new.go (98%) rename {internal/pkg => pkg}/mlrval/mlrval_new_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_output.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_output_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_sort.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_sort_test.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_type.go (100%) rename {internal/pkg => pkg}/mlrval/mlrval_type_test.go (100%) rename {internal/pkg => pkg}/output/README.md (100%) rename {internal/pkg => pkg}/output/channel_writer.go (96%) rename {internal/pkg => pkg}/output/doc.go (100%) rename {internal/pkg => pkg}/output/file_output_handlers.go (98%) rename {internal/pkg => pkg}/output/record_writer.go (92%) rename {internal/pkg => pkg}/output/record_writer_csv.go (94%) rename {internal/pkg => pkg}/output/record_writer_csv_colorizer.go (99%) rename {internal/pkg => pkg}/output/record_writer_csvlite.go (93%) rename {internal/pkg => pkg}/output/record_writer_dkvp.go (87%) rename {internal/pkg => pkg}/output/record_writer_factory.go (94%) rename {internal/pkg => pkg}/output/record_writer_json.go (96%) rename {internal/pkg => pkg}/output/record_writer_markdown.go (93%) rename {internal/pkg => pkg}/output/record_writer_nidx.go (88%) rename {internal/pkg => pkg}/output/record_writer_pprint.go (98%) rename {internal/pkg => pkg}/output/record_writer_tsv.go (92%) rename {internal/pkg => pkg}/output/record_writer_xtab.go (96%) rename {internal/pkg => pkg}/parsing/README.md (87%) rename {internal/pkg => pkg}/parsing/doc.go (100%) rename {internal/pkg => pkg}/parsing/errors.go.template (92%) rename {internal/pkg => pkg}/parsing/errors/doc.go (68%) rename {internal/pkg => pkg}/parsing/errors/errors.go (92%) rename {internal/pkg => pkg}/parsing/lexer/acttab.go (99%) rename {internal/pkg => pkg}/parsing/lexer/doc.go (67%) rename {internal/pkg => pkg}/parsing/lexer/lexer.go (99%) rename {internal/pkg => pkg}/parsing/lexer/transitiontable.go (100%) rename {internal/pkg => pkg}/parsing/mlr.bnf (99%) rename {internal/pkg => pkg}/parsing/parser/action.go (100%) rename {internal/pkg => pkg}/parsing/parser/actiontable.go (100%) rename {internal/pkg => pkg}/parsing/parser/context.go (100%) rename {internal/pkg => pkg}/parsing/parser/doc.go (68%) rename {internal/pkg => pkg}/parsing/parser/gototable.go (100%) rename {internal/pkg => pkg}/parsing/parser/parser.go (97%) rename {internal/pkg => pkg}/parsing/parser/productionstable.go (99%) rename {internal/pkg => pkg}/parsing/token/context.go (100%) rename {internal/pkg => pkg}/parsing/token/doc.go (67%) rename {internal/pkg => pkg}/parsing/token/token.go (100%) rename {internal/pkg => pkg}/parsing/util/doc.go (67%) rename {internal/pkg => pkg}/parsing/util/litconv.go (100%) rename {internal/pkg => pkg}/parsing/util/rune.go (100%) rename {internal/pkg => pkg}/pbnjay-strptime/README.md (100%) rename {internal/pkg => pkg}/pbnjay-strptime/strptime.go (100%) rename {internal/pkg => pkg}/pbnjay-strptime/strptime_test.go (100%) rename {internal/pkg => pkg}/platform/README.md (100%) rename {internal/pkg => pkg}/platform/diff_notwindows.go (100%) rename {internal/pkg => pkg}/platform/diff_windows.go (100%) rename {internal/pkg => pkg}/platform/doc.go (100%) rename {internal/pkg => pkg}/platform/getargs_notwindows.go (100%) rename {internal/pkg => pkg}/platform/getargs_windows.go (100%) rename {internal/pkg => pkg}/platform/shellrun_notwindows.go (100%) rename {internal/pkg => pkg}/platform/shellrun_windows.go (100%) rename {internal/pkg => pkg}/platform/terminal_notwindows.go (100%) rename {internal/pkg => pkg}/platform/terminal_windows.go (100%) rename {internal/pkg => pkg}/runtime/README.md (100%) rename {internal/pkg => pkg}/runtime/doc.go (100%) rename {internal/pkg => pkg}/runtime/stack.go (98%) rename {internal/pkg => pkg}/runtime/state.go (89%) rename {internal/pkg => pkg}/scan/digits.go (100%) rename {internal/pkg => pkg}/scan/digits_test.go (100%) rename {internal/pkg => pkg}/scan/doc.go (100%) rename {internal/pkg => pkg}/scan/find.go (100%) rename {internal/pkg => pkg}/scan/find_benchmark_test.go (94%) rename {internal/pkg => pkg}/scan/find_test.go (100%) rename {internal/pkg => pkg}/scan/type.go (100%) rename {internal/pkg => pkg}/scan/type_test.go (100%) rename {internal/pkg => pkg}/stream/README.md (100%) rename {internal/pkg => pkg}/stream/doc.go (100%) rename {internal/pkg => pkg}/stream/stream.go (94%) rename {internal/pkg => pkg}/terminals/doc.go (100%) rename {internal/pkg => pkg}/terminals/help/doc.go (100%) rename {internal/pkg => pkg}/terminals/help/entry.go (98%) rename {internal/pkg => pkg}/terminals/regtest/README.md (100%) rename {internal/pkg => pkg}/terminals/regtest/doc.go (100%) rename {internal/pkg => pkg}/terminals/regtest/entry.go (100%) rename {internal/pkg => pkg}/terminals/regtest/invoker.go (97%) rename {internal/pkg => pkg}/terminals/regtest/regtester.go (99%) rename {internal/pkg => pkg}/terminals/repl/README.md (100%) rename {internal/pkg => pkg}/terminals/repl/doc.go (100%) rename {internal/pkg => pkg}/terminals/repl/dsl.go (96%) rename {internal/pkg => pkg}/terminals/repl/entry.go (99%) rename {internal/pkg => pkg}/terminals/repl/prompt.go (92%) rename {internal/pkg => pkg}/terminals/repl/session.go (94%) rename {internal/pkg => pkg}/terminals/repl/types.go (88%) rename {internal/pkg => pkg}/terminals/repl/verbs.go (99%) rename {internal/pkg => pkg}/terminals/terminals.go (90%) rename {internal/pkg => pkg}/transformers/README.md (100%) rename {internal/pkg => pkg}/transformers/aaa_chain_transformer.go (99%) rename {internal/pkg => pkg}/transformers/aaa_record_transformer.go (95%) rename {internal/pkg => pkg}/transformers/aaa_transformer_table.go (96%) rename {internal/pkg => pkg}/transformers/altkv.go (95%) rename {internal/pkg => pkg}/transformers/bar.go (98%) rename {internal/pkg => pkg}/transformers/bootstrap.go (97%) rename {internal/pkg => pkg}/transformers/case.go (97%) rename {internal/pkg => pkg}/transformers/cat.go (97%) rename {internal/pkg => pkg}/transformers/check.go (97%) rename {internal/pkg => pkg}/transformers/clean_whitespace.go (96%) rename {internal/pkg => pkg}/transformers/count.go (97%) rename {internal/pkg => pkg}/transformers/count_similar.go (95%) rename {internal/pkg => pkg}/transformers/cut.go (97%) rename {internal/pkg => pkg}/transformers/decimate.go (97%) rename {internal/pkg => pkg}/transformers/doc.go (100%) rename {internal/pkg => pkg}/transformers/fill_down.go (97%) rename {internal/pkg => pkg}/transformers/fill_empty.go (95%) rename {internal/pkg => pkg}/transformers/flatten.go (97%) rename {internal/pkg => pkg}/transformers/format_values.go (97%) rename {internal/pkg => pkg}/transformers/fraction.go (97%) rename {internal/pkg => pkg}/transformers/gap.go (97%) rename {internal/pkg => pkg}/transformers/grep.go (97%) rename {internal/pkg => pkg}/transformers/group_by.go (96%) rename {internal/pkg => pkg}/transformers/group_like.go (95%) rename {internal/pkg => pkg}/transformers/gsub.go (94%) rename {internal/pkg => pkg}/transformers/having_fields.go (98%) rename {internal/pkg => pkg}/transformers/head.go (98%) rename {internal/pkg => pkg}/transformers/histogram.go (98%) rename {internal/pkg => pkg}/transformers/join.go (98%) rename {internal/pkg => pkg}/transformers/json_parse.go (97%) rename {internal/pkg => pkg}/transformers/json_stringify.go (96%) rename {internal/pkg => pkg}/transformers/label.go (95%) rename {internal/pkg => pkg}/transformers/latin1_to_utf8.go (93%) rename {internal/pkg => pkg}/transformers/merge_fields.go (98%) rename {internal/pkg => pkg}/transformers/most_or_least_frequent.go (97%) rename {internal/pkg => pkg}/transformers/nest.go (98%) rename {internal/pkg => pkg}/transformers/nothing.go (96%) rename {internal/pkg => pkg}/transformers/put_or_filter.go (97%) rename {internal/pkg => pkg}/transformers/regularize.go (94%) rename {internal/pkg => pkg}/transformers/remove_empty_columns.go (96%) rename {internal/pkg => pkg}/transformers/rename.go (98%) rename {internal/pkg => pkg}/transformers/reorder.go (97%) rename {internal/pkg => pkg}/transformers/repeat.go (98%) rename {internal/pkg => pkg}/transformers/reshape.go (98%) rename {internal/pkg => pkg}/transformers/sample.go (97%) rename {internal/pkg => pkg}/transformers/sec2gmt.go (95%) rename {internal/pkg => pkg}/transformers/sec2gmtdate.go (94%) rename {internal/pkg => pkg}/transformers/seqgen.go (96%) rename {internal/pkg => pkg}/transformers/shuffle.go (96%) rename {internal/pkg => pkg}/transformers/skip_trivial_records.go (96%) rename {internal/pkg => pkg}/transformers/sort.go (98%) rename {internal/pkg => pkg}/transformers/sort_within_records.go (97%) rename {internal/pkg => pkg}/transformers/split.go (98%) rename {internal/pkg => pkg}/transformers/ssub.go (94%) rename {internal/pkg => pkg}/transformers/stats1.go (98%) rename {internal/pkg => pkg}/transformers/stats2.go (98%) rename {internal/pkg => pkg}/transformers/step.go (99%) rename {internal/pkg => pkg}/transformers/sub.go (94%) rename {internal/pkg => pkg}/transformers/summary.go (98%) rename {internal/pkg => pkg}/transformers/tac.go (96%) rename {internal/pkg => pkg}/transformers/tail.go (96%) rename {internal/pkg => pkg}/transformers/tee.go (97%) rename {internal/pkg => pkg}/transformers/template.go (95%) rename {internal/pkg => pkg}/transformers/top.go (97%) rename {internal/pkg => pkg}/transformers/unflatten.go (97%) rename {internal/pkg => pkg}/transformers/uniq.go (98%) rename {internal/pkg => pkg}/transformers/unspace.go (97%) rename {internal/pkg => pkg}/transformers/unsparsify.go (96%) rename {internal/pkg => pkg}/transformers/utf8_to_latin1.go (93%) rename {internal/pkg => pkg}/transformers/utils/README.md (100%) rename {internal/pkg => pkg}/transformers/utils/doc.go (100%) rename {internal/pkg => pkg}/transformers/utils/join_bucket.go (92%) rename {internal/pkg => pkg}/transformers/utils/join_bucket_keeper.go (98%) rename {internal/pkg => pkg}/transformers/utils/percentile_keeper.go (97%) rename {internal/pkg => pkg}/transformers/utils/stats1_accumulators.go (99%) rename {internal/pkg => pkg}/transformers/utils/stats2_accumulators.go (99%) rename {internal/pkg => pkg}/transformers/utils/top_keeper.go (96%) rename {internal/pkg => pkg}/transformers/utils/window_keeper.go (97%) rename {internal/pkg => pkg}/transformers/utils/window_keeper_test.go (100%) rename {internal/pkg => pkg}/types/README.md (100%) rename {internal/pkg => pkg}/types/context.go (98%) rename {internal/pkg => pkg}/types/doc.go (100%) rename {internal/pkg => pkg}/types/indexed-lvalues.md (100%) rename {internal/pkg => pkg}/types/mlrval_typing.go (97%) rename {internal/pkg => pkg}/version/doc.go (100%) rename {internal/pkg => pkg}/version/version.go (100%) diff --git a/Makefile b/Makefile index 60c7ce578b..fb374cb910 100644 --- a/Makefile +++ b/Makefile @@ -30,25 +30,25 @@ install: build # ---------------------------------------------------------------- # Unit tests (small number) unit-test ut: build - go test github.com/johnkerl/miller/internal/pkg/... + go test github.com/johnkerl/miller/pkg/... ut-lib:build - go test github.com/johnkerl/miller/internal/pkg/lib... + go test github.com/johnkerl/miller/pkg/lib... ut-scan:build - go test github.com/johnkerl/miller/internal/pkg/scan/... + go test github.com/johnkerl/miller/pkg/scan/... ut-mlv:build - go test github.com/johnkerl/miller/internal/pkg/mlrval/... + go test github.com/johnkerl/miller/pkg/mlrval/... ut-bifs:build - go test github.com/johnkerl/miller/internal/pkg/bifs/... + go test github.com/johnkerl/miller/pkg/bifs/... ut-input:build - go test github.com/johnkerl/miller/internal/pkg/input/... + go test github.com/johnkerl/miller/pkg/input/... bench:build - go test -run=nonesuch -bench=. github.com/johnkerl/miller/internal/pkg/... + go test -run=nonesuch -bench=. github.com/johnkerl/miller/pkg/... bench-mlv:build - go test -run=nonesuch -bench=. github.com/johnkerl/miller/internal/pkg/mlrval/... + go test -run=nonesuch -bench=. github.com/johnkerl/miller/pkg/mlrval/... bench-input:build - go test -run=nonesuch -bench=. github.com/johnkerl/miller/internal/pkg/input/... + go test -run=nonesuch -bench=. github.com/johnkerl/miller/pkg/input/... # ---------------------------------------------------------------- # Regression tests (large number) @@ -56,7 +56,7 @@ bench-input:build # See ./regression_test.go for information on how to get more details # for debugging. TL;DR is for CI jobs, we have 'go test -v'; for # interactive use, instead of 'go test -v' simply use 'mlr regtest -# -vvv' or 'mlr regtest -s 20'. See also internal/pkg/terminals/regtest. +# -vvv' or 'mlr regtest -s 20'. See also pkg/terminals/regtest. regression-test: build go test -v regression_test.go @@ -65,7 +65,7 @@ regression-test: build # go fmt ./... finds experimental C files which we want to ignore. fmt format: -go fmt ./cmd/... - -go fmt ./internal/pkg/... + -go fmt ./pkg/... -go fmt ./regression_test.go # ---------------------------------------------------------------- diff --git a/README-dev.md b/README-dev.md index 6c3b5ca8cb..0e363db5c8 100644 --- a/README-dev.md +++ b/README-dev.md @@ -61,10 +61,10 @@ During the coding of Miller, I've been guided by the following: * Names of files, variables, functions, etc. should be fully spelled out (e.g. `NewEvaluableLeafNode`), except for a small number of most-used names where a longer name would cause unnecessary line-wraps (e.g. `Mlrval` instead of `MillerValue` since this appears very very often). * Code should not be too clever. This includes some reasonable amounts of code duplication from time to time, to keep things inline, rather than lasagna code. * Things should be transparent. For example, the `-v` in `mlr -n put -v '$y = 3 + 0.1 * $x'` shows you the abstract syntax tree derived from the DSL expression. - * Comments should be robust with respect to reasonably anticipated changes. For example, one package should cross-link to another in its comments, but I try to avoid mentioning specific filenames too much in the comments and README files since these may change over time. I make an exception for stable points such as [cmd/mlr/main.go](./cmd/mlr/main.go), [mlr.bnf](./internal/pkg/parsing/mlr.bnf), [stream.go](./internal/pkg/stream/stream.go), etc. + * Comments should be robust with respect to reasonably anticipated changes. For example, one package should cross-link to another in its comments, but I try to avoid mentioning specific filenames too much in the comments and README files since these may change over time. I make an exception for stable points such as [cmd/mlr/main.go](./cmd/mlr/main.go), [mlr.bnf](./pkg/parsing/mlr.bnf), [stream.go](./pkg/stream/stream.go), etc. * *Miller should be pleasant to write.* * It should be quick to answer the question *Did I just break anything?* -- hence `mlr regtest` functionality. - * It should be quick to find out what to do next as you iteratively develop -- see for example [cst/README.md](./internal/pkg/dsl/cst/README.md). + * It should be quick to find out what to do next as you iteratively develop -- see for example [cst/README.md](./pkg/dsl/cst/README.md). * *The language should be an asset, not a liability.* * One of the reasons I chose Go is that (personally anyway) I find it to be reasonably efficient, well-supported with standard libraries, straightforward, and fun. I hope you enjoy it as much as I have. @@ -83,10 +83,10 @@ sequence of key-value pairs. The basic **stream** operation is: So, in broad overview, the key packages are: -* [internal/pkg/stream](./internal/pkg/stream) -- connect input -> transforms -> output via Go channels -* [internal/pkg/input](./internal/pkg/input) -- read input records -* [internal/pkg/transformers](./internal/pkg/transformers) -- transform input records to output records -* [internal/pkg/output](./internal/pkg/output) -- write output records +* [pkg/stream](./pkg/stream) -- connect input -> transforms -> output via Go channels +* [pkg/input](./pkg/input) -- read input records +* [pkg/transformers](./pkg/transformers) -- transform input records to output records +* [pkg/output](./pkg/output) -- write output records * The rest are details to support this. ## Directory-structure details @@ -98,7 +98,7 @@ So, in broad overview, the key packages are: * This package defines the grammar for Miller's domain-specific language (DSL) for the Miller `put` and `filter` verbs. And, GOCC is a joy to use. :) * It is used on the terms of its open-source license. * [golang.org/x/term](https://pkg.go.dev/golang.org/x/term): - * Just a one-line Miller callsite for is-a-terminal checking for the [Miller REPL](./internal/pkg/terminals/repl/README.md). + * Just a one-line Miller callsite for is-a-terminal checking for the [Miller REPL](./pkg/terminals/repl/README.md). * It is used on the terms of its open-source license. * See also [./go.mod](go.mod). Setup: * `go get github.com/goccmack/gocc` @@ -106,22 +106,22 @@ So, in broad overview, the key packages are: ### Miller per se -* The main entry point is [cmd/mlr/main.go](./cmd/mlr/main.go); everything else in [internal/pkg](./internal/pkg). -* [internal/pkg/entrypoint](./internal/pkg/entrypoint): All the usual contents of `main()` are here, for ease of testing. -* [internal/pkg/platform](./internal/pkg/platform): Platform-dependent code, which as of early 2021 is the command-line parser. Handling single quotes and double quotes is different on Windows unless particular care is taken, which is what this package does. -* [internal/pkg/lib](./internal/pkg/lib): - * Implementation of the [`Mlrval`](./internal/pkg/types/mlrval.go) datatype which includes string/int/float/boolean/void/absent/error types. These are used for record values, as well as expression/variable values in the Miller `put`/`filter` DSL. See also below for more details. - * [`Mlrmap`](./internal/pkg/types/mlrmap.go) is the sequence of key-value pairs which represents a Miller record. The key-lookup mechanism is optimized for Miller read/write usage patterns -- please see [mlrmap.go](./internal/pkg/types/mlrmap.go) for more details. - * [`context`](./internal/pkg/types/context.go) supports AWK-like variables such as `FILENAME`, `NF`, `NR`, and so on. -* [internal/pkg/cli](./internal/pkg/cli) is the flag-parsing logic for supporting Miller's command-line interface. When you type something like `mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv`, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer-chain of `put` then `filter`, and a JSON record-writer. -* [internal/pkg/climain](./internal/pkg/climain) contains a layer which invokes `internal/pkg/cli`, which was split out to avoid a Go package-import cycle. -* [internal/pkg/stream](./internal/pkg/stream) is as above -- it uses Go channels to pipe together file-reads, to record-reading/parsing, to a chain of record-transformers, to record-writing/formatting, to terminal standard output. -* [internal/pkg/input](./internal/pkg/input) is as above -- one record-reader type per supported input file format, and a factory method. -* [internal/pkg/output](./internal/pkg/output) is as above -- one record-writer type per supported output file format, and a factory method. -* [internal/pkg/transformers](./internal/pkg/transformers) contains the abstract record-transformer interface datatype, as well as the Go-channel chaining mechanism for piping one transformer into the next. It also contains all the concrete record-transformers such as `cat`, `tac`, `sort`, `put`, and so on. -* [internal/pkg/parsing](./internal/pkg/parsing) contains a single source file, `mlr.bnf`, which is the lexical/semantic grammar file for the Miller `put`/`filter` DSL using the GOCC framework. All subdirectories of `internal/pkg/parsing/` are autogen code created by GOCC's processing of `mlr.bnf`. If you need to edit `mlr.bnf`, please use [tools/build-dsl](./tools/build-dsl) to autogenerate Go code from it (using the GOCC tool). (This takes several minutes to run.) -* [internal/pkg/dsl](./internal/pkg/dsl) contains [`ast_types.go`](internal/pkg/dsl/ast_types.go) which is the abstract syntax tree datatype shared between GOCC and Miller. I didn't use a `internal/pkg/dsl/ast` naming convention, although that would have been nice, in order to avoid a Go package-dependency cycle. -* [internal/pkg/dsl/cst](./internal/pkg/dsl/cst) is the concrete syntax tree, constructed from an AST produced by GOCC. The CST is what is actually executed on every input record when you do things like `$z = $x * 0.3 * $y`. Please see the [internal/pkg/dsl/cst/README.md](./internal/pkg/dsl/cst/README.md) for more information. +* The main entry point is [cmd/mlr/main.go](./cmd/mlr/main.go); everything else in [pkg](./pkg). +* [pkg/entrypoint](./pkg/entrypoint): All the usual contents of `main()` are here, for ease of testing. +* [pkg/platform](./pkg/platform): Platform-dependent code, which as of early 2021 is the command-line parser. Handling single quotes and double quotes is different on Windows unless particular care is taken, which is what this package does. +* [pkg/lib](./pkg/lib): + * Implementation of the [`Mlrval`](./pkg/types/mlrval.go) datatype which includes string/int/float/boolean/void/absent/error types. These are used for record values, as well as expression/variable values in the Miller `put`/`filter` DSL. See also below for more details. + * [`Mlrmap`](./pkg/types/mlrmap.go) is the sequence of key-value pairs which represents a Miller record. The key-lookup mechanism is optimized for Miller read/write usage patterns -- please see [mlrmap.go](./pkg/types/mlrmap.go) for more details. + * [`context`](./pkg/types/context.go) supports AWK-like variables such as `FILENAME`, `NF`, `NR`, and so on. +* [pkg/cli](./pkg/cli) is the flag-parsing logic for supporting Miller's command-line interface. When you type something like `mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv`, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer-chain of `put` then `filter`, and a JSON record-writer. +* [pkg/climain](./pkg/climain) contains a layer which invokes `pkg/cli`, which was split out to avoid a Go package-import cycle. +* [pkg/stream](./pkg/stream) is as above -- it uses Go channels to pipe together file-reads, to record-reading/parsing, to a chain of record-transformers, to record-writing/formatting, to terminal standard output. +* [pkg/input](./pkg/input) is as above -- one record-reader type per supported input file format, and a factory method. +* [pkg/output](./pkg/output) is as above -- one record-writer type per supported output file format, and a factory method. +* [pkg/transformers](./pkg/transformers) contains the abstract record-transformer interface datatype, as well as the Go-channel chaining mechanism for piping one transformer into the next. It also contains all the concrete record-transformers such as `cat`, `tac`, `sort`, `put`, and so on. +* [pkg/parsing](./pkg/parsing) contains a single source file, `mlr.bnf`, which is the lexical/semantic grammar file for the Miller `put`/`filter` DSL using the GOCC framework. All subdirectories of `pkg/parsing/` are autogen code created by GOCC's processing of `mlr.bnf`. If you need to edit `mlr.bnf`, please use [tools/build-dsl](./tools/build-dsl) to autogenerate Go code from it (using the GOCC tool). (This takes several minutes to run.) +* [pkg/dsl](./pkg/dsl) contains [`ast_types.go`](pkg/dsl/ast_types.go) which is the abstract syntax tree datatype shared between GOCC and Miller. I didn't use a `pkg/dsl/ast` naming convention, although that would have been nice, in order to avoid a Go package-dependency cycle. +* [pkg/dsl/cst](./pkg/dsl/cst) is the concrete syntax tree, constructed from an AST produced by GOCC. The CST is what is actually executed on every input record when you do things like `$z = $x * 0.3 * $y`. Please see the [pkg/dsl/cst/README.md](./pkg/dsl/cst/README.md) for more information. ## Nil-record conventions @@ -153,7 +153,7 @@ nil through the reader/transformer/writer sequence. ## More about mlrvals -[`Mlrval`](./internal/pkg/types/mlrval.go) is the datatype of record values, as well as expression/variable values in the Miller `put`/`filter` DSL. It includes string/int/float/boolean/void/absent/error types, not unlike PHP's `zval`. +[`Mlrval`](./pkg/types/mlrval.go) is the datatype of record values, as well as expression/variable values in the Miller `put`/`filter` DSL. It includes string/int/float/boolean/void/absent/error types, not unlike PHP's `zval`. * Miller's `absent` type is like Javascript's `undefined` -- it's for times when there is no such key, as in a DSL expression `$out = $foo` when the input record is `$x=3,y=4` -- there is no `$foo` so `$foo` has `absent` type. Nothing is written to the `$out` field in this case. See also [here](https://miller.readthedocs.io/en/latest/reference-main-null-data) for more information. * Miller's `void` type is like Javascript's `null` -- it's for times when there is a key with no value, as in `$out = $x` when the input record is `$x=,$y=4`. This is an overlap with `string` type, since a void value looks like an empty string. I've gone back and forth on this (including when I was writing the C implementation) -- whether to retain `void` as a distinct type from empty-string, or not. I ended up keeping it as it made the `Mlrval` logic easier to understand. @@ -161,7 +161,7 @@ nil through the reader/transformer/writer sequence. * Miller's number handling makes auto-overflow from int to float transparent, while preserving the possibility of 64-bit bitwise arithmetic. * This is different from JavaScript, which has only double-precision floats and thus no support for 64-bit numbers (note however that there is now [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)). * This is also different from C and Go, wherein casts are necessary -- without which int arithmetic overflows. - * See also [here](https://miller.readthedocs.io/en/latest/reference-main-arithmetic) for the semantics of Miller arithmetic, which the [`Mlrval`](./internal/pkg/types/mlrval.go) class implements. + * See also [here](https://miller.readthedocs.io/en/latest/reference-main-arithmetic) for the semantics of Miller arithmetic, which the [`Mlrval`](./pkg/types/mlrval.go) class implements. ## Performance optimizations diff --git a/README.md b/README.md index c1a1977b47..0b9cd76e34 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ See also [building from source](https://miller.readthedocs.io/en/latest/build.ht * You can do `./configure --prefix=/some/install/path` before `make install` if you want to install somewhere other than `/usr/local`. * Without `make`: * To build: `go build github.com/johnkerl/miller/cmd/mlr`. - * To run tests: `go test github.com/johnkerl/miller/internal/pkg/...` and `mlr regtest`. + * To run tests: `go test github.com/johnkerl/miller/pkg/...` and `mlr regtest`. * To install: `go install github.com/johnkerl/miller/cmd/mlr` will install to _GOPATH_`/bin/mlr`. * See also the doc page on [building from source](https://miller.readthedocs.io/en/latest/build). * For more developer information please see [README-dev.md](./README-dev.md). diff --git a/cmd/experiments/colors/main.go b/cmd/experiments/colors/main.go index 305fa6062a..5f5093eeee 100644 --- a/cmd/experiments/colors/main.go +++ b/cmd/experiments/colors/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/colorizer" + "github.com/johnkerl/miller/pkg/colorizer" ) const boldString = "\u001b[1m" diff --git a/cmd/mlr/main.go b/cmd/mlr/main.go index 23ed5b5b62..3e37bdca10 100644 --- a/cmd/mlr/main.go +++ b/cmd/mlr/main.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/johnkerl/miller/internal/pkg/entrypoint" + "github.com/johnkerl/miller/pkg/entrypoint" "github.com/pkg/profile" // for trace.out ) diff --git a/cmd/scan/main.go b/cmd/scan/main.go index c185b87524..f93e0226e6 100644 --- a/cmd/scan/main.go +++ b/cmd/scan/main.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/scan" + "github.com/johnkerl/miller/pkg/scan" ) func main() { diff --git a/cmd/sizes/main.go b/cmd/sizes/main.go index 82a4905b0e..5ae6209cca 100644 --- a/cmd/sizes/main.go +++ b/cmd/sizes/main.go @@ -11,7 +11,7 @@ package main import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func main() { diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 5ea29ed163..287d929c75 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -109,6 +109,7 @@ nav: - "Auxiliary commands": "reference-main-auxiliary-commands.md" - "Manual page": "manpage.md" - "Building from source": "build.md" + - "Miller as a library": "miller-as-library.md" - "How to create a new release": "how-to-release.md" - "Documents for previous releases": "release-docs.md" - "Glossary": "glossary.md" diff --git a/docs/src/build.md b/docs/src/build.md index e2a6c59f9a..0b6787898a 100644 --- a/docs/src/build.md +++ b/docs/src/build.md @@ -33,7 +33,7 @@ Two-clause BSD license [https://github.com/johnkerl/miller/blob/master/LICENSE.t * `make` creates the `./mlr` (or `.\mlr.exe` on Windows) executable * Without `make`: `go build github.com/johnkerl/miller/cmd/mlr` * `make check` runs tests - * Without `make`: `go test github.com/johnkerl/miller/internal/pkg/...` and `mlr regtest` + * Without `make`: `go test github.com/johnkerl/miller/pkg/...` and `mlr regtest` * `make install` installs the `mlr` executable and the `mlr` manpage * Without make: `go install github.com/johnkerl/miller/cmd/mlr` will install to _GOPATH_`/bin/mlr` diff --git a/docs/src/build.md.in b/docs/src/build.md.in index b01464d200..5138c9b8fb 100644 --- a/docs/src/build.md.in +++ b/docs/src/build.md.in @@ -17,7 +17,7 @@ Two-clause BSD license [https://github.com/johnkerl/miller/blob/master/LICENSE.t * `make` creates the `./mlr` (or `.\mlr.exe` on Windows) executable * Without `make`: `go build github.com/johnkerl/miller/cmd/mlr` * `make check` runs tests - * Without `make`: `go test github.com/johnkerl/miller/internal/pkg/...` and `mlr regtest` + * Without `make`: `go test github.com/johnkerl/miller/pkg/...` and `mlr regtest` * `make install` installs the `mlr` executable and the `mlr` manpage * Without make: `go install github.com/johnkerl/miller/cmd/mlr` will install to _GOPATH_`/bin/mlr` diff --git a/docs/src/how-to-release.md b/docs/src/how-to-release.md index 4c7e97628f..d8675cdbc0 100644 --- a/docs/src/how-to-release.md +++ b/docs/src/how-to-release.md @@ -22,7 +22,7 @@ In this example I am using version 6.2.0 to 6.3.0; of course that will change fo * Update version found in `mlr --version` and `man mlr`: - * Edit `internal/pkg/version/version.go` from `6.2.0-dev` to `6.3.0`. + * Edit `pkg/version/version.go` from `6.2.0-dev` to `6.3.0`. * Edit `miller.spec`: `Version`, and `changelog` entry * Run `make dev` in the Miller repo base directory * The ordering in this makefile rule is important: the first build creates `mlr`; the second runs `mlr` to create `manpage.txt`; the third includes `manpage.txt` into one of its outputs. @@ -69,6 +69,6 @@ In this example I am using version 6.2.0 to 6.3.0; of course that will change fo * Afterwork: - * Edit `internal/pkg/version/version.go` to change version from `6.3.0` to `6.3.0-dev`. + * Edit `pkg/version/version.go` to change version from `6.3.0` to `6.3.0-dev`. * `make dev` * Commit and push. diff --git a/docs/src/how-to-release.md.in b/docs/src/how-to-release.md.in index ad26704cf9..2754a2bfdb 100644 --- a/docs/src/how-to-release.md.in +++ b/docs/src/how-to-release.md.in @@ -6,7 +6,7 @@ In this example I am using version 6.2.0 to 6.3.0; of course that will change fo * Update version found in `mlr --version` and `man mlr`: - * Edit `internal/pkg/version/version.go` from `6.2.0-dev` to `6.3.0`. + * Edit `pkg/version/version.go` from `6.2.0-dev` to `6.3.0`. * Edit `miller.spec`: `Version`, and `changelog` entry * Run `make dev` in the Miller repo base directory * The ordering in this makefile rule is important: the first build creates `mlr`; the second runs `mlr` to create `manpage.txt`; the third includes `manpage.txt` into one of its outputs. @@ -53,6 +53,6 @@ In this example I am using version 6.2.0 to 6.3.0; of course that will change fo * Afterwork: - * Edit `internal/pkg/version/version.go` to change version from `6.3.0` to `6.3.0-dev`. + * Edit `pkg/version/version.go` to change version from `6.3.0` to `6.3.0-dev`. * `make dev` * Commit and push. diff --git a/docs/src/manpage.md b/docs/src/manpage.md index 0d22cfdab3..0037efeb2e 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -3645,5 +3645,5 @@ MILLER(1) MILLER(1) - 2023-08-31 MILLER(1) + 2023-09-10 MILLER(1) diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index ccf519ceda..3087f568ff 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -3624,4 +3624,4 @@ MILLER(1) MILLER(1) - 2023-08-31 MILLER(1) + 2023-09-10 MILLER(1) diff --git a/docs/src/miller-as-library.md b/docs/src/miller-as-library.md new file mode 100644 index 0000000000..49c381138a --- /dev/null +++ b/docs/src/miller-as-library.md @@ -0,0 +1,202 @@ + +
+ +Quick links: +  +Flags +  +Verbs +  +Functions +  +Glossary +  +Release docs + +
+# Miller as a library + +Very initially and experimentally, as of Miller 6.9.1, Go developers will be able to access Miller source +code --- moved from `internal/pkg/` to `pkg/` --- within their own Go projects. + +## Setup + +``` +$ mkdir use-mlr + +$ cd cd use-mlr + +$ go mod init github.com/johnkerl/miller-library-example +go: creating new go.mod: module github.com/johnkerl/miller-library-example + +# One of: +$ go get github.com/johnkerl/miller +$ go get github.com/johnkerl/miller@0f27a39a9f92d4c633dd29d99ad203e95a484dd3 +# Etc. + +$ go mod tidy +``` + +## One example use + +
+package main
+
+import (
+	"fmt"
+
+	"github.com/johnkerl/miller/pkg/bifs"
+	"github.com/johnkerl/miller/pkg/mlrval"
+)
+
+func main() {
+	a := mlrval.FromInt(2)
+	b := mlrval.FromInt(60)
+	c := bifs.BIF_pow(a, b)
+	fmt.Println(c.String())
+}
+
+ +``` +$ go build main1.go +$ ./main1 +1152921504606846976 +``` + +Or simply: +``` +$ go run main1.go +1152921504606846976 +``` + +## Another example use + +
+package main
+
+import (
+	"bufio"
+	"container/list"
+	"errors"
+	"fmt"
+	"os"
+
+	"github.com/johnkerl/miller/pkg/cli"
+	"github.com/johnkerl/miller/pkg/input"
+	"github.com/johnkerl/miller/pkg/output"
+	"github.com/johnkerl/miller/pkg/transformers"
+	"github.com/johnkerl/miller/pkg/types"
+)
+
+func convert_csv_to_json(fileNames []string) error {
+	options := &cli.TOptions{
+		ReaderOptions: cli.TReaderOptions{
+			InputFileFormat: "csv",
+			IFS:             ",",
+			IRS:             "\n",
+			RecordsPerBatch: 1,
+		},
+		WriterOptions: cli.TWriterOptions{
+			OutputFileFormat: "json",
+		},
+	}
+	outputStream := os.Stdout
+	outputIsStdout := true
+
+	// Since Go is concurrent, the context struct needs to be duplicated and
+	// passed through the channels along with each record.
+	initialContext := types.NewContext()
+
+	// Instantiate the record-reader.
+	// RecordsPerBatch is tracked separately from ReaderOptions since join/repl
+	// may use batch size of 1.
+	recordReader, err := input.Create(&options.ReaderOptions, options.ReaderOptions.RecordsPerBatch)
+	if err != nil {
+		return err
+	}
+
+	// Instantiate the record-writer
+	recordWriter, err := output.Create(&options.WriterOptions)
+	if err != nil {
+		return err
+	}
+
+	cat, err := transformers.NewTransformerCat(
+		false, // doCounters bool,
+		"",    // counterFieldName string,
+		nil,   // groupByFieldNames []string,
+		false, // doFileName bool,
+		false, // doFileNum bool,
+	)
+	if err != nil {
+		return err
+	}
+	recordTransformers := []transformers.IRecordTransformer{cat}
+
+	// Set up the reader-to-transformer and transformer-to-writer channels.
+	readerChannel := make(chan *list.List, 2) // list of *types.RecordAndContext
+	writerChannel := make(chan *list.List, 1) // list of *types.RecordAndContext
+
+	// We're done when a fatal error is registered on input (file not found,
+	// etc) or when the record-writer has written all its output. We use
+	// channels to communicate both of these conditions.
+	inputErrorChannel := make(chan error, 1)
+	doneWritingChannel := make(chan bool, 1)
+	dataProcessingErrorChannel := make(chan bool, 1)
+
+	readerDownstreamDoneChannel := make(chan bool, 1)
+
+	// Start the reader, transformer, and writer. Let them run until fatal input
+	// error or end-of-processing happens.
+	bufferedOutputStream := bufio.NewWriter(outputStream)
+
+	go recordReader.Read(fileNames, *initialContext, readerChannel, inputErrorChannel, readerDownstreamDoneChannel)
+	go transformers.ChainTransformer(readerChannel, readerDownstreamDoneChannel, recordTransformers,
+		writerChannel, options)
+	go output.ChannelWriter(writerChannel, recordWriter, &options.WriterOptions, doneWritingChannel,
+		dataProcessingErrorChannel, bufferedOutputStream, outputIsStdout)
+
+	var retval error
+	done := false
+	for !done {
+		select {
+		case ierr := <-inputErrorChannel:
+			retval = ierr
+			break
+		case _ = <-dataProcessingErrorChannel:
+			retval = errors.New("exiting due to data error") // details already printed
+			break
+		case _ = <-doneWritingChannel:
+			done = true
+			break
+		}
+	}
+
+	bufferedOutputStream.Flush()
+
+	return retval
+}
+
+func main() {
+	err := convert_csv_to_json(os.Args[1:])
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "%v\n", err)
+	}
+}
+
+ +
+host,status
+apoapsis.east.our.org,up
+nadir.west.our.org,down
+
+ +``` +$ go build main2.go +$ ./main2 data/hostnames.csv +{"host": "apoapsis.east.our.org", "status": "up"} +{"host": "nadir.west.our.org", "status": "down"} +``` + + + diff --git a/docs/src/miller-as-library.md.in b/docs/src/miller-as-library.md.in new file mode 100644 index 0000000000..b7051165bc --- /dev/null +++ b/docs/src/miller-as-library.md.in @@ -0,0 +1,54 @@ +# Miller as a library + +Very initially and experimentally, as of Miller 6.9.1, Go developers will be able to access Miller source +code --- moved from `internal/pkg/` to `pkg/` --- within their own Go projects. + +## Setup + +``` +$ mkdir use-mlr + +$ cd cd use-mlr + +$ go mod init github.com/johnkerl/miller-library-example +go: creating new go.mod: module github.com/johnkerl/miller-library-example + +# One of: +$ go get github.com/johnkerl/miller +$ go get github.com/johnkerl/miller@0f27a39a9f92d4c633dd29d99ad203e95a484dd3 +# Etc. + +$ go mod tidy +``` + +## One example use + +GENMD-INCLUDE-ESCAPED(miller-as-library/main1.go) + +``` +$ go build main1.go +$ ./main1 +1152921504606846976 +``` + +Or simply: +``` +$ go run main1.go +1152921504606846976 +``` + +## Another example use + +GENMD-INCLUDE-ESCAPED(miller-as-library/main2.go) + +GENMD-INCLUDE-ESCAPED(data/hostnames.csv) + +``` +$ go build main2.go +$ ./main2 data/hostnames.csv +{"host": "apoapsis.east.our.org", "status": "up"} +{"host": "nadir.west.our.org", "status": "down"} +``` + + + diff --git a/docs/src/miller-as-library/main1.go b/docs/src/miller-as-library/main1.go new file mode 100644 index 0000000000..c56f5a0db9 --- /dev/null +++ b/docs/src/miller-as-library/main1.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/mlrval" +) + +func main() { + a := mlrval.FromInt(2) + b := mlrval.FromInt(60) + c := bifs.BIF_pow(a, b) + fmt.Println(c.String()) +} diff --git a/docs/src/miller-as-library/main2.go b/docs/src/miller-as-library/main2.go new file mode 100644 index 0000000000..07d4be50e9 --- /dev/null +++ b/docs/src/miller-as-library/main2.go @@ -0,0 +1,111 @@ +package main + +import ( + "bufio" + "container/list" + "errors" + "fmt" + "os" + + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/input" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/transformers" + "github.com/johnkerl/miller/pkg/types" +) + +func convert_csv_to_json(fileNames []string) error { + options := &cli.TOptions{ + ReaderOptions: cli.TReaderOptions{ + InputFileFormat: "csv", + IFS: ",", + IRS: "\n", + RecordsPerBatch: 1, + }, + WriterOptions: cli.TWriterOptions{ + OutputFileFormat: "json", + }, + } + outputStream := os.Stdout + outputIsStdout := true + + // Since Go is concurrent, the context struct needs to be duplicated and + // passed through the channels along with each record. + initialContext := types.NewContext() + + // Instantiate the record-reader. + // RecordsPerBatch is tracked separately from ReaderOptions since join/repl + // may use batch size of 1. + recordReader, err := input.Create(&options.ReaderOptions, options.ReaderOptions.RecordsPerBatch) + if err != nil { + return err + } + + // Instantiate the record-writer + recordWriter, err := output.Create(&options.WriterOptions) + if err != nil { + return err + } + + cat, err := transformers.NewTransformerCat( + false, // doCounters bool, + "", // counterFieldName string, + nil, // groupByFieldNames []string, + false, // doFileName bool, + false, // doFileNum bool, + ) + if err != nil { + return err + } + recordTransformers := []transformers.IRecordTransformer{cat} + + // Set up the reader-to-transformer and transformer-to-writer channels. + readerChannel := make(chan *list.List, 2) // list of *types.RecordAndContext + writerChannel := make(chan *list.List, 1) // list of *types.RecordAndContext + + // We're done when a fatal error is registered on input (file not found, + // etc) or when the record-writer has written all its output. We use + // channels to communicate both of these conditions. + inputErrorChannel := make(chan error, 1) + doneWritingChannel := make(chan bool, 1) + dataProcessingErrorChannel := make(chan bool, 1) + + readerDownstreamDoneChannel := make(chan bool, 1) + + // Start the reader, transformer, and writer. Let them run until fatal input + // error or end-of-processing happens. + bufferedOutputStream := bufio.NewWriter(outputStream) + + go recordReader.Read(fileNames, *initialContext, readerChannel, inputErrorChannel, readerDownstreamDoneChannel) + go transformers.ChainTransformer(readerChannel, readerDownstreamDoneChannel, recordTransformers, + writerChannel, options) + go output.ChannelWriter(writerChannel, recordWriter, &options.WriterOptions, doneWritingChannel, + dataProcessingErrorChannel, bufferedOutputStream, outputIsStdout) + + var retval error + done := false + for !done { + select { + case ierr := <-inputErrorChannel: + retval = ierr + break + case _ = <-dataProcessingErrorChannel: + retval = errors.New("exiting due to data error") // details already printed + break + case _ = <-doneWritingChannel: + done = true + break + } + } + + bufferedOutputStream.Flush() + + return retval +} + +func main() { + err := convert_csv_to_json(os.Args[1:]) + if err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + } +} diff --git a/internal/pkg/cli/README.md b/internal/pkg/cli/README.md deleted file mode 100644 index eb6f483002..0000000000 --- a/internal/pkg/cli/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Datatypes for parsing the Miller command line, and the flags table. - -* `internal/pkg/climain` is the flag-parsing logic for supporting Miller's command-line interface. When you type something like `mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv`, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer chain of `put` then `filter`, and a JSON record-writer. -* `internal/pkg/cli` contains datatypes and the flags table for the CLI-parser, which was split out to avoid a Go package-import cycle. diff --git a/man/manpage.txt b/man/manpage.txt index ccf519ceda..3087f568ff 100644 --- a/man/manpage.txt +++ b/man/manpage.txt @@ -3624,4 +3624,4 @@ MILLER(1) MILLER(1) - 2023-08-31 MILLER(1) + 2023-09-10 MILLER(1) diff --git a/man/mlr.1 b/man/mlr.1 index b8794a3521..a98daa9060 100644 --- a/man/mlr.1 +++ b/man/mlr.1 @@ -2,12 +2,12 @@ .\" Title: mlr .\" Author: [see the "AUTHOR" section] .\" Generator: ./mkman.rb -.\" Date: 2023-08-31 +.\" Date: 2023-09-10 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "MILLER" "1" "2023-08-31" "\ \&" "\ \&" +.TH "MILLER" "1" "2023-09-10" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Portability definitions .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/internal/pkg/README.md b/pkg/README.md similarity index 100% rename from internal/pkg/README.md rename to pkg/README.md diff --git a/internal/pkg/auxents/auxents.go b/pkg/auxents/auxents.go similarity index 100% rename from internal/pkg/auxents/auxents.go rename to pkg/auxents/auxents.go diff --git a/internal/pkg/auxents/doc.go b/pkg/auxents/doc.go similarity index 100% rename from internal/pkg/auxents/doc.go rename to pkg/auxents/doc.go diff --git a/internal/pkg/auxents/hex.go b/pkg/auxents/hex.go similarity index 100% rename from internal/pkg/auxents/hex.go rename to pkg/auxents/hex.go diff --git a/internal/pkg/auxents/lecat.go b/pkg/auxents/lecat.go similarity index 100% rename from internal/pkg/auxents/lecat.go rename to pkg/auxents/lecat.go diff --git a/internal/pkg/auxents/termcvt.go b/pkg/auxents/termcvt.go similarity index 100% rename from internal/pkg/auxents/termcvt.go rename to pkg/auxents/termcvt.go diff --git a/internal/pkg/auxents/unhex.go b/pkg/auxents/unhex.go similarity index 100% rename from internal/pkg/auxents/unhex.go rename to pkg/auxents/unhex.go diff --git a/internal/pkg/bifs/arithmetic.go b/pkg/bifs/arithmetic.go similarity index 99% rename from internal/pkg/bifs/arithmetic.go rename to pkg/bifs/arithmetic.go index 7728270ec7..f5a2b853e9 100644 --- a/internal/pkg/bifs/arithmetic.go +++ b/pkg/bifs/arithmetic.go @@ -4,8 +4,8 @@ import ( "fmt" "math" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ================================================================ diff --git a/internal/pkg/bifs/arithmetic_test.go b/pkg/bifs/arithmetic_test.go similarity index 98% rename from internal/pkg/bifs/arithmetic_test.go rename to pkg/bifs/arithmetic_test.go index 2890c37e70..76efd45eac 100644 --- a/internal/pkg/bifs/arithmetic_test.go +++ b/pkg/bifs/arithmetic_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func TestBIF_plus_unary(t *testing.T) { diff --git a/internal/pkg/bifs/base.go b/pkg/bifs/base.go similarity index 98% rename from internal/pkg/bifs/base.go rename to pkg/bifs/base.go index c0bf0e8109..28aa0d6bf7 100644 --- a/internal/pkg/bifs/base.go +++ b/pkg/bifs/base.go @@ -50,9 +50,9 @@ package bifs import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // Function-pointer type for zary functions. diff --git a/internal/pkg/bifs/bits.go b/pkg/bifs/bits.go similarity index 99% rename from internal/pkg/bifs/bits.go rename to pkg/bifs/bits.go index 7fb786307b..5ed8cc20e7 100644 --- a/internal/pkg/bifs/bits.go +++ b/pkg/bifs/bits.go @@ -1,7 +1,7 @@ package bifs import ( - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) // ================================================================ diff --git a/internal/pkg/bifs/bits_test.go b/pkg/bifs/bits_test.go similarity index 87% rename from internal/pkg/bifs/bits_test.go rename to pkg/bifs/bits_test.go index bc88698a14..96718e00d3 100644 --- a/internal/pkg/bifs/bits_test.go +++ b/pkg/bifs/bits_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func TestBIF_bitcount(t *testing.T) { diff --git a/internal/pkg/bifs/booleans.go b/pkg/bifs/booleans.go similarity index 95% rename from internal/pkg/bifs/booleans.go rename to pkg/bifs/booleans.go index da77c61993..c0b3bc3dba 100644 --- a/internal/pkg/bifs/booleans.go +++ b/pkg/bifs/booleans.go @@ -5,7 +5,7 @@ package bifs import ( - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func BIF_logical_NOT(input1 *mlrval.Mlrval) *mlrval.Mlrval { diff --git a/internal/pkg/bifs/cmp.go b/pkg/bifs/cmp.go similarity index 99% rename from internal/pkg/bifs/cmp.go rename to pkg/bifs/cmp.go index 7d31cb7eea..832feab570 100644 --- a/internal/pkg/bifs/cmp.go +++ b/pkg/bifs/cmp.go @@ -5,8 +5,8 @@ package bifs import ( - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/internal/pkg/bifs/collections.go b/pkg/bifs/collections.go similarity index 99% rename from internal/pkg/bifs/collections.go rename to pkg/bifs/collections.go index 5278b5b6a1..a734ee4519 100644 --- a/internal/pkg/bifs/collections.go +++ b/pkg/bifs/collections.go @@ -5,8 +5,8 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ================================================================ diff --git a/internal/pkg/bifs/collections_test.go b/pkg/bifs/collections_test.go similarity index 98% rename from internal/pkg/bifs/collections_test.go rename to pkg/bifs/collections_test.go index 417ae35346..16ffba8c63 100644 --- a/internal/pkg/bifs/collections_test.go +++ b/pkg/bifs/collections_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func TestBIF_length(t *testing.T) { diff --git a/internal/pkg/bifs/datetime.go b/pkg/bifs/datetime.go similarity index 99% rename from internal/pkg/bifs/datetime.go rename to pkg/bifs/datetime.go index 4126078b15..9fa11e6b0e 100644 --- a/internal/pkg/bifs/datetime.go +++ b/pkg/bifs/datetime.go @@ -5,11 +5,11 @@ import ( "regexp" "time" - strptime "github.com/johnkerl/miller/internal/pkg/pbnjay-strptime" + strptime "github.com/johnkerl/miller/pkg/pbnjay-strptime" "github.com/lestrrat-go/strftime" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) const ISO8601_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" diff --git a/internal/pkg/bifs/hashing.go b/pkg/bifs/hashing.go similarity index 95% rename from internal/pkg/bifs/hashing.go rename to pkg/bifs/hashing.go index 09552ab0f3..e2d09d1e41 100644 --- a/internal/pkg/bifs/hashing.go +++ b/pkg/bifs/hashing.go @@ -7,7 +7,7 @@ import ( "crypto/sha512" "fmt" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func BIF_md5(input1 *mlrval.Mlrval) *mlrval.Mlrval { diff --git a/internal/pkg/bifs/hashing_test.go b/pkg/bifs/hashing_test.go similarity index 91% rename from internal/pkg/bifs/hashing_test.go rename to pkg/bifs/hashing_test.go index 3e736c0a04..6b44028be7 100644 --- a/internal/pkg/bifs/hashing_test.go +++ b/pkg/bifs/hashing_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func TestBIF_md5(t *testing.T) { diff --git a/internal/pkg/bifs/mathlib.go b/pkg/bifs/mathlib.go similarity index 99% rename from internal/pkg/bifs/mathlib.go rename to pkg/bifs/mathlib.go index b18e0d4ed1..b415cb8091 100644 --- a/internal/pkg/bifs/mathlib.go +++ b/pkg/bifs/mathlib.go @@ -7,8 +7,8 @@ package bifs import ( "math" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/bifs/percentiles.go b/pkg/bifs/percentiles.go similarity index 99% rename from internal/pkg/bifs/percentiles.go rename to pkg/bifs/percentiles.go index 087e7f2000..cecb98aec8 100644 --- a/internal/pkg/bifs/percentiles.go +++ b/pkg/bifs/percentiles.go @@ -3,7 +3,7 @@ package bifs import ( "math" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func GetPercentileLinearlyInterpolated( diff --git a/internal/pkg/bifs/random.go b/pkg/bifs/random.go similarity index 94% rename from internal/pkg/bifs/random.go rename to pkg/bifs/random.go index 5562b4d301..c85509da66 100644 --- a/internal/pkg/bifs/random.go +++ b/pkg/bifs/random.go @@ -3,8 +3,8 @@ package bifs import ( "math" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) func BIF_urand() *mlrval.Mlrval { diff --git a/internal/pkg/bifs/regex.go b/pkg/bifs/regex.go similarity index 98% rename from internal/pkg/bifs/regex.go rename to pkg/bifs/regex.go index 72a6878b43..52cab9ac5e 100644 --- a/internal/pkg/bifs/regex.go +++ b/pkg/bifs/regex.go @@ -3,8 +3,8 @@ package bifs import ( "strings" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // BIF_ssub implements the ssub function -- no-frills string-replace, no diff --git a/internal/pkg/bifs/relative_time.go b/pkg/bifs/relative_time.go similarity index 99% rename from internal/pkg/bifs/relative_time.go rename to pkg/bifs/relative_time.go index d6d57b16a9..f36258ffe4 100644 --- a/internal/pkg/bifs/relative_time.go +++ b/pkg/bifs/relative_time.go @@ -5,7 +5,7 @@ import ( "math" "strings" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func BIF_dhms2sec(input1 *mlrval.Mlrval) *mlrval.Mlrval { diff --git a/internal/pkg/bifs/stats.go b/pkg/bifs/stats.go similarity index 99% rename from internal/pkg/bifs/stats.go rename to pkg/bifs/stats.go index c809f71671..ff3531a314 100644 --- a/internal/pkg/bifs/stats.go +++ b/pkg/bifs/stats.go @@ -4,8 +4,8 @@ import ( "math" "sort" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/bifs/stats_test.go b/pkg/bifs/stats_test.go similarity index 99% rename from internal/pkg/bifs/stats_test.go rename to pkg/bifs/stats_test.go index 3fc21c84aa..735ceab835 100644 --- a/internal/pkg/bifs/stats_test.go +++ b/pkg/bifs/stats_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) func stats_test_array(n int) *mlrval.Mlrval { diff --git a/internal/pkg/bifs/strings.go b/pkg/bifs/strings.go similarity index 99% rename from internal/pkg/bifs/strings.go rename to pkg/bifs/strings.go index 7ef8019a47..cd68ee4808 100644 --- a/internal/pkg/bifs/strings.go +++ b/pkg/bifs/strings.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ================================================================ diff --git a/internal/pkg/bifs/system.go b/pkg/bifs/system.go similarity index 93% rename from internal/pkg/bifs/system.go rename to pkg/bifs/system.go index a3ac73ad41..d56f0bb669 100644 --- a/internal/pkg/bifs/system.go +++ b/pkg/bifs/system.go @@ -6,9 +6,9 @@ import ( "runtime" "strings" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/platform" - "github.com/johnkerl/miller/internal/pkg/version" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/platform" + "github.com/johnkerl/miller/pkg/version" ) func BIF_version() *mlrval.Mlrval { diff --git a/internal/pkg/bifs/types.go b/pkg/bifs/types.go similarity index 98% rename from internal/pkg/bifs/types.go rename to pkg/bifs/types.go index b57e0dc849..87ee80448d 100644 --- a/internal/pkg/bifs/types.go +++ b/pkg/bifs/types.go @@ -5,9 +5,9 @@ import ( "math" "os" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ================================================================ diff --git a/pkg/cli/README.md b/pkg/cli/README.md new file mode 100644 index 0000000000..f08cc1abaa --- /dev/null +++ b/pkg/cli/README.md @@ -0,0 +1,4 @@ +Datatypes for parsing the Miller command line, and the flags table. + +* `pkg/climain` is the flag-parsing logic for supporting Miller's command-line interface. When you type something like `mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv`, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer chain of `put` then `filter`, and a JSON record-writer. +* `pkg/cli` contains datatypes and the flags table for the CLI-parser, which was split out to avoid a Go package-import cycle. diff --git a/internal/pkg/cli/doc.go b/pkg/cli/doc.go similarity index 100% rename from internal/pkg/cli/doc.go rename to pkg/cli/doc.go diff --git a/internal/pkg/cli/flag_types.go b/pkg/cli/flag_types.go similarity index 99% rename from internal/pkg/cli/flag_types.go rename to pkg/cli/flag_types.go index bcb86e2904..590487d43c 100644 --- a/internal/pkg/cli/flag_types.go +++ b/pkg/cli/flag_types.go @@ -18,7 +18,7 @@ // o Autogenerating webdocs (mkdocs). // // * For these reasons, flags are organized into tables; for documentation -// purposes, flags are organized into sections (see internal/pkg/cli/option_parse.go). +// purposes, flags are organized into sections (see pkg/cli/option_parse.go). // // * The Flag struct separates out flag name (e.g. `--csv`), any alternate // names (e.g. `-c`), any arguments the flag may take, a help string, and a @@ -42,8 +42,8 @@ import ( "sort" "strings" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/cli/flatten_unflatten.go b/pkg/cli/flatten_unflatten.go similarity index 100% rename from internal/pkg/cli/flatten_unflatten.go rename to pkg/cli/flatten_unflatten.go diff --git a/internal/pkg/cli/mlrcli_util.go b/pkg/cli/mlrcli_util.go similarity index 100% rename from internal/pkg/cli/mlrcli_util.go rename to pkg/cli/mlrcli_util.go diff --git a/internal/pkg/cli/option_parse.go b/pkg/cli/option_parse.go similarity index 99% rename from internal/pkg/cli/option_parse.go rename to pkg/cli/option_parse.go index 013deb5822..7f838a0960 100644 --- a/internal/pkg/cli/option_parse.go +++ b/pkg/cli/option_parse.go @@ -13,9 +13,9 @@ import ( "github.com/mattn/go-isatty" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // FinalizeReaderOptions does a few things. diff --git a/internal/pkg/cli/option_types.go b/pkg/cli/option_types.go similarity index 99% rename from internal/pkg/cli/option_types.go rename to pkg/cli/option_types.go index b70d4a2f7f..d959e0c52c 100644 --- a/internal/pkg/cli/option_types.go +++ b/pkg/cli/option_types.go @@ -9,7 +9,7 @@ package cli import ( "regexp" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) type TCommentHandling int diff --git a/internal/pkg/cli/separators.go b/pkg/cli/separators.go similarity index 100% rename from internal/pkg/cli/separators.go rename to pkg/cli/separators.go diff --git a/internal/pkg/cli/verb_utils.go b/pkg/cli/verb_utils.go similarity index 98% rename from internal/pkg/cli/verb_utils.go rename to pkg/cli/verb_utils.go index 9dda91ebd7..421af9af83 100644 --- a/internal/pkg/cli/verb_utils.go +++ b/pkg/cli/verb_utils.go @@ -9,7 +9,7 @@ import ( "os" "strconv" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // For flags with values, e.g. ["-n" "10"], while we're looking at the "-n" this let us see if the "10" slot exists. diff --git a/internal/pkg/climain/README.md b/pkg/climain/README.md similarity index 51% rename from internal/pkg/climain/README.md rename to pkg/climain/README.md index a1b380667d..1cd6b186da 100644 --- a/internal/pkg/climain/README.md +++ b/pkg/climain/README.md @@ -1,5 +1,5 @@ Logic for parsing the Miller command line. -* `internal/pkg/climain` is the flag-parsing logic for supporting Miller's command-line interface. When you type something like `mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv`, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer chain of `put` then `filter`, and a JSON record-writer. -* `internal/pkg/cli` contains datatypes for the CLI-parser, which was split out to avoid a Go package-import cycle. +* `pkg/climain` is the flag-parsing logic for supporting Miller's command-line interface. When you type something like `mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv`, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer chain of `put` then `filter`, and a JSON record-writer. +* `pkg/cli` contains datatypes for the CLI-parser, which was split out to avoid a Go package-import cycle. * I don't use the Go [`flag`](https://golang.org/pkg/flag/) package. The `flag` package is quite fine; Miller's command-line processing is multi-purpose between serving CLI needs per se as well as for manpage/docfile generation, and I found it simplest to roll my own command-line handling here. More importantly, some Miller verbs such as ``sort`` take flags more than once -- ``mlr sort -f field1 -n field2 -f field3`` -- which is not supported by the `flag` package. diff --git a/internal/pkg/climain/doc.go b/pkg/climain/doc.go similarity index 100% rename from internal/pkg/climain/doc.go rename to pkg/climain/doc.go diff --git a/internal/pkg/climain/mlrcli_mlrrc.go b/pkg/climain/mlrcli_mlrrc.go similarity index 98% rename from internal/pkg/climain/mlrcli_mlrrc.go rename to pkg/climain/mlrcli_mlrrc.go index beb4aa45c1..d3c5c14019 100644 --- a/internal/pkg/climain/mlrcli_mlrrc.go +++ b/pkg/climain/mlrcli_mlrrc.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" + "github.com/johnkerl/miller/pkg/cli" ) // loadMlrrcOrDie rule: If $MLRRC is set, use it and only it. Otherwise try diff --git a/internal/pkg/climain/mlrcli_parse.go b/pkg/climain/mlrcli_parse.go similarity index 97% rename from internal/pkg/climain/mlrcli_parse.go rename to pkg/climain/mlrcli_parse.go index e68b5902ed..9e8679eef0 100644 --- a/internal/pkg/climain/mlrcli_parse.go +++ b/pkg/climain/mlrcli_parse.go @@ -74,13 +74,13 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/terminals" - "github.com/johnkerl/miller/internal/pkg/terminals/help" - "github.com/johnkerl/miller/internal/pkg/transformers" - "github.com/johnkerl/miller/internal/pkg/version" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/terminals" + "github.com/johnkerl/miller/pkg/terminals/help" + "github.com/johnkerl/miller/pkg/transformers" + "github.com/johnkerl/miller/pkg/version" ) // ParseCommandLine is the entrypoint for handling the Miller command line: diff --git a/internal/pkg/climain/mlrcli_shebang.go b/pkg/climain/mlrcli_shebang.go similarity index 98% rename from internal/pkg/climain/mlrcli_shebang.go rename to pkg/climain/mlrcli_shebang.go index e465ed2b76..b05643bced 100644 --- a/internal/pkg/climain/mlrcli_shebang.go +++ b/pkg/climain/mlrcli_shebang.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" shellquote "github.com/kballard/go-shellquote" ) diff --git a/internal/pkg/colorizer/README.md b/pkg/colorizer/README.md similarity index 58% rename from internal/pkg/colorizer/README.md rename to pkg/colorizer/README.md index 8ac92b0fee..b507e1936a 100644 --- a/internal/pkg/colorizer/README.md +++ b/pkg/colorizer/README.md @@ -1,4 +1,4 @@ ANSI colors for key/value color highlighting, test pass/fail, etc. -Not placed in the internal/pkg/platform directory since these don't check the build-for +Not placed in the pkg/platform directory since these don't check the build-for platform but rather simply the TERM environment variable. diff --git a/internal/pkg/colorizer/colorizer.go b/pkg/colorizer/colorizer.go similarity index 100% rename from internal/pkg/colorizer/colorizer.go rename to pkg/colorizer/colorizer.go diff --git a/internal/pkg/colorizer/doc.go b/pkg/colorizer/doc.go similarity index 100% rename from internal/pkg/colorizer/doc.go rename to pkg/colorizer/doc.go diff --git a/internal/pkg/dsl/README.md b/pkg/dsl/README.md similarity index 94% rename from internal/pkg/dsl/README.md rename to pkg/dsl/README.md index 53ff79eb31..923f413db2 100644 --- a/internal/pkg/dsl/README.md +++ b/pkg/dsl/README.md @@ -97,5 +97,5 @@ tree is executed once on every data record. # Source directories/files -* The AST logic is in `./ast*.go`. I didn't use a `internal/pkg/dsl/ast` naming convention, although that would have been nice, in order to avoid a Go package-dependency cycle. +* The AST logic is in `./ast*.go`. I didn't use a `pkg/dsl/ast` naming convention, although that would have been nice, in order to avoid a Go package-dependency cycle. * The CST logic is in [`./cst`](./cst). Please see [cst/README.md](./cst/README.md) for more information. diff --git a/internal/pkg/dsl/ast_build.go b/pkg/dsl/ast_build.go similarity index 98% rename from internal/pkg/dsl/ast_build.go rename to pkg/dsl/ast_build.go index 47f3a583da..f417998f69 100644 --- a/internal/pkg/dsl/ast_build.go +++ b/pkg/dsl/ast_build.go @@ -8,8 +8,8 @@ package dsl import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/parsing/token" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/ast_print.go b/pkg/dsl/ast_print.go similarity index 100% rename from internal/pkg/dsl/ast_print.go rename to pkg/dsl/ast_print.go diff --git a/internal/pkg/dsl/ast_types.go b/pkg/dsl/ast_types.go similarity index 99% rename from internal/pkg/dsl/ast_types.go rename to pkg/dsl/ast_types.go index 825b338e98..6856ce8303 100644 --- a/internal/pkg/dsl/ast_types.go +++ b/pkg/dsl/ast_types.go @@ -5,7 +5,7 @@ package dsl import ( - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/parsing/token" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/README.md b/pkg/dsl/cst/README.md similarity index 93% rename from internal/pkg/dsl/cst/README.md rename to pkg/dsl/cst/README.md index 02dc6f73ae..d1936faf9d 100644 --- a/internal/pkg/dsl/cst/README.md +++ b/pkg/dsl/cst/README.md @@ -11,7 +11,7 @@ See [../dsl/README.md](../README.md) for more information about Miller's use of Go is a strongly typed language, but the AST is polymorphic. This results in if/else or switch statements as an AST is walked. -Also, when we modify code, there can be changes in the [BNF grammar](../../parsing/mlr.bnf) not yet reflected in the [AST](../../internal/pkg/dsl/ast_types.go). Likewise, there can be AST changes not yet reflected here. (Example: you are partway through adding a new binary operator to the grammar.) +Also, when we modify code, there can be changes in the [BNF grammar](../../parsing/mlr.bnf) not yet reflected in the [AST](../../pkg/dsl/ast_types.go). Likewise, there can be AST changes not yet reflected here. (Example: you are partway through adding a new binary operator to the grammar.) As a result, throughout the code, there are error checks which may seem redundant but which are in place to make incremental development more pleasant and robust. diff --git a/internal/pkg/dsl/cst/assignments.go b/pkg/dsl/cst/assignments.go similarity index 94% rename from internal/pkg/dsl/cst/assignments.go rename to pkg/dsl/cst/assignments.go index 41540ed20e..129ec850c4 100644 --- a/internal/pkg/dsl/cst/assignments.go +++ b/pkg/dsl/cst/assignments.go @@ -5,9 +5,9 @@ package cst import ( - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/runtime" ) // ================================================================ diff --git a/internal/pkg/dsl/cst/block_exit.go b/pkg/dsl/cst/block_exit.go similarity index 94% rename from internal/pkg/dsl/cst/block_exit.go rename to pkg/dsl/cst/block_exit.go index 3a912a9908..b52b363cb5 100644 --- a/internal/pkg/dsl/cst/block_exit.go +++ b/pkg/dsl/cst/block_exit.go @@ -8,9 +8,9 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/blocks.go b/pkg/dsl/cst/blocks.go similarity index 96% rename from internal/pkg/dsl/cst/blocks.go rename to pkg/dsl/cst/blocks.go index 6eb805b118..d51c70d75e 100644 --- a/internal/pkg/dsl/cst/blocks.go +++ b/pkg/dsl/cst/blocks.go @@ -6,9 +6,9 @@ package cst import ( - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/builtin_function_manager.go b/pkg/dsl/cst/builtin_function_manager.go similarity index 99% rename from internal/pkg/dsl/cst/builtin_function_manager.go rename to pkg/dsl/cst/builtin_function_manager.go index e9154dc607..7fbf60f3da 100644 --- a/internal/pkg/dsl/cst/builtin_function_manager.go +++ b/pkg/dsl/cst/builtin_function_manager.go @@ -19,9 +19,9 @@ import ( "sort" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) type TFunctionClass string diff --git a/internal/pkg/dsl/cst/builtin_functions.go b/pkg/dsl/cst/builtin_functions.go similarity index 99% rename from internal/pkg/dsl/cst/builtin_functions.go rename to pkg/dsl/cst/builtin_functions.go index dfc1b45966..26f1daccee 100644 --- a/internal/pkg/dsl/cst/builtin_functions.go +++ b/pkg/dsl/cst/builtin_functions.go @@ -7,11 +7,11 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/collections.go b/pkg/dsl/cst/collections.go similarity index 98% rename from internal/pkg/dsl/cst/collections.go rename to pkg/dsl/cst/collections.go index 66d63788fa..1dcee4daf3 100644 --- a/internal/pkg/dsl/cst/collections.go +++ b/pkg/dsl/cst/collections.go @@ -8,11 +8,11 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/cond.go b/pkg/dsl/cst/cond.go similarity index 88% rename from internal/pkg/dsl/cst/cond.go rename to pkg/dsl/cst/cond.go index cd5f0c128b..f7f0063e35 100644 --- a/internal/pkg/dsl/cst/cond.go +++ b/pkg/dsl/cst/cond.go @@ -8,11 +8,11 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/parsing/token" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/runtime" ) type CondBlockNode struct { diff --git a/internal/pkg/dsl/cst/doc.go b/pkg/dsl/cst/doc.go similarity index 100% rename from internal/pkg/dsl/cst/doc.go rename to pkg/dsl/cst/doc.go diff --git a/internal/pkg/dsl/cst/dump.go b/pkg/dsl/cst/dump.go similarity index 96% rename from internal/pkg/dsl/cst/dump.go rename to pkg/dsl/cst/dump.go index a53e43a1b9..14070527db 100644 --- a/internal/pkg/dsl/cst/dump.go +++ b/pkg/dsl/cst/dump.go @@ -21,11 +21,11 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ================================================================ diff --git a/internal/pkg/dsl/cst/emit1.go b/pkg/dsl/cst/emit1.go similarity index 92% rename from internal/pkg/dsl/cst/emit1.go rename to pkg/dsl/cst/emit1.go index 5a43105c79..a4996e312e 100644 --- a/internal/pkg/dsl/cst/emit1.go +++ b/pkg/dsl/cst/emit1.go @@ -22,10 +22,10 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) type Emit1StatementNode struct { diff --git a/internal/pkg/dsl/cst/emit_emitp.go b/pkg/dsl/cst/emit_emitp.go similarity index 98% rename from internal/pkg/dsl/cst/emit_emitp.go rename to pkg/dsl/cst/emit_emitp.go index 43e87243f3..3552f023d2 100644 --- a/internal/pkg/dsl/cst/emit_emitp.go +++ b/pkg/dsl/cst/emit_emitp.go @@ -41,13 +41,13 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ================================================================ diff --git a/internal/pkg/dsl/cst/emitf.go b/pkg/dsl/cst/emitf.go similarity index 95% rename from internal/pkg/dsl/cst/emitf.go rename to pkg/dsl/cst/emitf.go index 213149e863..97aebfe980 100644 --- a/internal/pkg/dsl/cst/emitf.go +++ b/pkg/dsl/cst/emitf.go @@ -8,12 +8,12 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ================================================================ diff --git a/internal/pkg/dsl/cst/env.go b/pkg/dsl/cst/env.go similarity index 87% rename from internal/pkg/dsl/cst/env.go rename to pkg/dsl/cst/env.go index 73e37c3437..c2f038f2da 100644 --- a/internal/pkg/dsl/cst/env.go +++ b/pkg/dsl/cst/env.go @@ -10,10 +10,10 @@ package cst import ( "os" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) type EnvironmentVariableNode struct { diff --git a/internal/pkg/dsl/cst/evaluable.go b/pkg/dsl/cst/evaluable.go similarity index 96% rename from internal/pkg/dsl/cst/evaluable.go rename to pkg/dsl/cst/evaluable.go index d46cab5b18..9440537bab 100644 --- a/internal/pkg/dsl/cst/evaluable.go +++ b/pkg/dsl/cst/evaluable.go @@ -10,10 +10,10 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/filter.go b/pkg/dsl/cst/filter.go similarity index 95% rename from internal/pkg/dsl/cst/filter.go rename to pkg/dsl/cst/filter.go index dfab5ceee6..4a4d3984e1 100644 --- a/internal/pkg/dsl/cst/filter.go +++ b/pkg/dsl/cst/filter.go @@ -19,9 +19,9 @@ package cst import ( - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/for.go b/pkg/dsl/cst/for.go similarity index 99% rename from internal/pkg/dsl/cst/for.go rename to pkg/dsl/cst/for.go index 3e9b7e309b..34d6b808d2 100644 --- a/internal/pkg/dsl/cst/for.go +++ b/pkg/dsl/cst/for.go @@ -7,11 +7,11 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/parsing/token" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/functions.go b/pkg/dsl/cst/functions.go similarity index 97% rename from internal/pkg/dsl/cst/functions.go rename to pkg/dsl/cst/functions.go index d601a06441..5aca6d3978 100644 --- a/internal/pkg/dsl/cst/functions.go +++ b/pkg/dsl/cst/functions.go @@ -9,8 +9,8 @@ package cst import ( - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/hofs.go b/pkg/dsl/cst/hofs.go similarity index 99% rename from internal/pkg/dsl/cst/hofs.go rename to pkg/dsl/cst/hofs.go index 9257d7f461..87edc01b28 100644 --- a/internal/pkg/dsl/cst/hofs.go +++ b/pkg/dsl/cst/hofs.go @@ -14,12 +14,12 @@ import ( "github.com/facette/natsort" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) -// Most function types are in the github.com/johnkerl/miller/internal/pkg/types package. These types, though, +// Most function types are in the github.com/johnkerl/miller/pkg/types package. These types, though, // include functions which need to access CST state in order to call back to // user-defined functions. To avoid a package-cycle dependency, they are // defined here. diff --git a/internal/pkg/dsl/cst/if.go b/pkg/dsl/cst/if.go similarity index 94% rename from internal/pkg/dsl/cst/if.go rename to pkg/dsl/cst/if.go index 40da46c7ae..b947c7f6e4 100644 --- a/internal/pkg/dsl/cst/if.go +++ b/pkg/dsl/cst/if.go @@ -7,11 +7,11 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/parsing/token" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/keyword_usage.go b/pkg/dsl/cst/keyword_usage.go similarity index 99% rename from internal/pkg/dsl/cst/keyword_usage.go rename to pkg/dsl/cst/keyword_usage.go index 23340ccf89..c5bec8f7a9 100644 --- a/internal/pkg/dsl/cst/keyword_usage.go +++ b/pkg/dsl/cst/keyword_usage.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/leaves.go b/pkg/dsl/cst/leaves.go similarity index 98% rename from internal/pkg/dsl/cst/leaves.go rename to pkg/dsl/cst/leaves.go index 41b9cef3a7..382525e524 100644 --- a/internal/pkg/dsl/cst/leaves.go +++ b/pkg/dsl/cst/leaves.go @@ -8,10 +8,10 @@ import ( "fmt" "math" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/lvalues.go b/pkg/dsl/cst/lvalues.go similarity index 99% rename from internal/pkg/dsl/cst/lvalues.go rename to pkg/dsl/cst/lvalues.go index 6be69e88b1..073c5d991b 100644 --- a/internal/pkg/dsl/cst/lvalues.go +++ b/pkg/dsl/cst/lvalues.go @@ -9,10 +9,10 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/print.go b/pkg/dsl/cst/print.go similarity index 97% rename from internal/pkg/dsl/cst/print.go rename to pkg/dsl/cst/print.go index a7318c3987..8c68593beb 100644 --- a/internal/pkg/dsl/cst/print.go +++ b/pkg/dsl/cst/print.go @@ -9,11 +9,11 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/root.go b/pkg/dsl/cst/root.go similarity index 97% rename from internal/pkg/dsl/cst/root.go rename to pkg/dsl/cst/root.go index 979c82ad17..f48ebc3307 100644 --- a/internal/pkg/dsl/cst/root.go +++ b/pkg/dsl/cst/root.go @@ -11,13 +11,13 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/parsing/lexer" - "github.com/johnkerl/miller/internal/pkg/parsing/parser" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/parsing/lexer" + "github.com/johnkerl/miller/pkg/parsing/parser" + "github.com/johnkerl/miller/pkg/runtime" ) // NewEmptyRoot sets up an empty CST, before ingesting any DSL strings. For diff --git a/internal/pkg/dsl/cst/signature.go b/pkg/dsl/cst/signature.go similarity index 95% rename from internal/pkg/dsl/cst/signature.go rename to pkg/dsl/cst/signature.go index aeac8e80a7..1ee5547635 100644 --- a/internal/pkg/dsl/cst/signature.go +++ b/pkg/dsl/cst/signature.go @@ -6,7 +6,7 @@ package cst import ( - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/statements.go b/pkg/dsl/cst/statements.go similarity index 98% rename from internal/pkg/dsl/cst/statements.go rename to pkg/dsl/cst/statements.go index 1ea5ca0265..ce42cb8544 100644 --- a/internal/pkg/dsl/cst/statements.go +++ b/pkg/dsl/cst/statements.go @@ -8,7 +8,7 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" + "github.com/johnkerl/miller/pkg/dsl" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/subroutines.go b/pkg/dsl/cst/subroutines.go similarity index 96% rename from internal/pkg/dsl/cst/subroutines.go rename to pkg/dsl/cst/subroutines.go index b91326a811..6c1b76dae1 100644 --- a/internal/pkg/dsl/cst/subroutines.go +++ b/pkg/dsl/cst/subroutines.go @@ -9,8 +9,8 @@ package cst import ( - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/tee.go b/pkg/dsl/cst/tee.go similarity index 94% rename from internal/pkg/dsl/cst/tee.go rename to pkg/dsl/cst/tee.go index b76ac43209..df9b8ff0b2 100644 --- a/internal/pkg/dsl/cst/tee.go +++ b/pkg/dsl/cst/tee.go @@ -7,12 +7,12 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/types.go b/pkg/dsl/cst/types.go similarity index 95% rename from internal/pkg/dsl/cst/types.go rename to pkg/dsl/cst/types.go index e9a606afd1..4fa935edff 100644 --- a/internal/pkg/dsl/cst/types.go +++ b/pkg/dsl/cst/types.go @@ -7,10 +7,10 @@ package cst import ( "container/list" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/udf.go b/pkg/dsl/cst/udf.go similarity index 98% rename from internal/pkg/dsl/cst/udf.go rename to pkg/dsl/cst/udf.go index 83c1a5b091..9be4bf59c0 100644 --- a/internal/pkg/dsl/cst/udf.go +++ b/pkg/dsl/cst/udf.go @@ -8,11 +8,11 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/uds.go b/pkg/dsl/cst/uds.go similarity index 97% rename from internal/pkg/dsl/cst/uds.go rename to pkg/dsl/cst/uds.go index 944db7a11a..3a72e4c238 100644 --- a/internal/pkg/dsl/cst/uds.go +++ b/pkg/dsl/cst/uds.go @@ -7,11 +7,11 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/validate.go b/pkg/dsl/cst/validate.go similarity index 98% rename from internal/pkg/dsl/cst/validate.go rename to pkg/dsl/cst/validate.go index e5e4746ef9..305c1bf7f4 100644 --- a/internal/pkg/dsl/cst/validate.go +++ b/pkg/dsl/cst/validate.go @@ -9,8 +9,8 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/warn.go b/pkg/dsl/cst/warn.go similarity index 98% rename from internal/pkg/dsl/cst/warn.go rename to pkg/dsl/cst/warn.go index a66874ee9d..55850c8b16 100644 --- a/internal/pkg/dsl/cst/warn.go +++ b/pkg/dsl/cst/warn.go @@ -11,8 +11,8 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/dsl/cst/while.go b/pkg/dsl/cst/while.go similarity index 95% rename from internal/pkg/dsl/cst/while.go rename to pkg/dsl/cst/while.go index 538c1f1530..4e088df6cd 100644 --- a/internal/pkg/dsl/cst/while.go +++ b/pkg/dsl/cst/while.go @@ -7,10 +7,10 @@ package cst import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/parsing/token" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/runtime" ) // ================================================================ diff --git a/internal/pkg/dsl/doc.go b/pkg/dsl/doc.go similarity index 100% rename from internal/pkg/dsl/doc.go rename to pkg/dsl/doc.go diff --git a/internal/pkg/dsl/token.go b/pkg/dsl/token.go similarity index 87% rename from internal/pkg/dsl/token.go rename to pkg/dsl/token.go index 1cf624d4e9..ff79d26e0f 100644 --- a/internal/pkg/dsl/token.go +++ b/pkg/dsl/token.go @@ -3,7 +3,7 @@ package dsl import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/parsing/token" ) // TokenToLocationInfo is used to track runtime errors back to source-code locations in DSL diff --git a/internal/pkg/entrypoint/README.md b/pkg/entrypoint/README.md similarity index 100% rename from internal/pkg/entrypoint/README.md rename to pkg/entrypoint/README.md diff --git a/internal/pkg/entrypoint/doc.go b/pkg/entrypoint/doc.go similarity index 100% rename from internal/pkg/entrypoint/doc.go rename to pkg/entrypoint/doc.go diff --git a/internal/pkg/entrypoint/entrypoint.go b/pkg/entrypoint/entrypoint.go similarity index 94% rename from internal/pkg/entrypoint/entrypoint.go rename to pkg/entrypoint/entrypoint.go index f48a8f10b6..7f7fab7119 100644 --- a/internal/pkg/entrypoint/entrypoint.go +++ b/pkg/entrypoint/entrypoint.go @@ -11,13 +11,13 @@ import ( "os" "path" - "github.com/johnkerl/miller/internal/pkg/auxents" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/climain" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/platform" - "github.com/johnkerl/miller/internal/pkg/stream" - "github.com/johnkerl/miller/internal/pkg/transformers" + "github.com/johnkerl/miller/pkg/auxents" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/climain" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/platform" + "github.com/johnkerl/miller/pkg/stream" + "github.com/johnkerl/miller/pkg/transformers" ) type MainReturn struct { diff --git a/internal/pkg/go-csv/LICENSE b/pkg/go-csv/LICENSE similarity index 100% rename from internal/pkg/go-csv/LICENSE rename to pkg/go-csv/LICENSE diff --git a/internal/pkg/go-csv/README.md b/pkg/go-csv/README.md similarity index 100% rename from internal/pkg/go-csv/README.md rename to pkg/go-csv/README.md diff --git a/internal/pkg/go-csv/csv_reader.go b/pkg/go-csv/csv_reader.go similarity index 100% rename from internal/pkg/go-csv/csv_reader.go rename to pkg/go-csv/csv_reader.go diff --git a/internal/pkg/go-csv/csv_writer.go b/pkg/go-csv/csv_writer.go similarity index 100% rename from internal/pkg/go-csv/csv_writer.go rename to pkg/go-csv/csv_writer.go diff --git a/internal/pkg/input/README.md b/pkg/input/README.md similarity index 100% rename from internal/pkg/input/README.md rename to pkg/input/README.md diff --git a/internal/pkg/input/doc.go b/pkg/input/doc.go similarity index 100% rename from internal/pkg/input/doc.go rename to pkg/input/doc.go diff --git a/internal/pkg/input/pseudo_reader_gen.go b/pkg/input/pseudo_reader_gen.go similarity index 96% rename from internal/pkg/input/pseudo_reader_gen.go rename to pkg/input/pseudo_reader_gen.go index 2808ce451e..6479cb4d72 100644 --- a/internal/pkg/input/pseudo_reader_gen.go +++ b/pkg/input/pseudo_reader_gen.go @@ -4,10 +4,10 @@ import ( "container/list" "fmt" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) type PseudoReaderGen struct { diff --git a/internal/pkg/input/record_reader.go b/pkg/input/record_reader.go similarity index 96% rename from internal/pkg/input/record_reader.go rename to pkg/input/record_reader.go index b56a25ceb4..2802019363 100644 --- a/internal/pkg/input/record_reader.go +++ b/pkg/input/record_reader.go @@ -10,9 +10,9 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) const CSV_BOM = "\xef\xbb\xbf" diff --git a/internal/pkg/input/record_reader_benchmark_test.go b/pkg/input/record_reader_benchmark_test.go similarity index 92% rename from internal/pkg/input/record_reader_benchmark_test.go rename to pkg/input/record_reader_benchmark_test.go index 93ce898570..9d23529831 100644 --- a/internal/pkg/input/record_reader_benchmark_test.go +++ b/pkg/input/record_reader_benchmark_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/cli" + "github.com/johnkerl/miller/pkg/cli" ) -// go test -run=nonesuch -bench=. github.com/johnkerl/miller/internal/pkg/input/... +// go test -run=nonesuch -bench=. github.com/johnkerl/miller/pkg/input/... func BenchmarkDKVPParse(b *testing.B) { readerOptions := &cli.TReaderOptions{ diff --git a/internal/pkg/input/record_reader_csv.go b/pkg/input/record_reader_csv.go similarity index 97% rename from internal/pkg/input/record_reader_csv.go rename to pkg/input/record_reader_csv.go index fc1da8dc73..b2c2f18531 100644 --- a/internal/pkg/input/record_reader_csv.go +++ b/pkg/input/record_reader_csv.go @@ -8,12 +8,12 @@ import ( "strconv" "strings" - csv "github.com/johnkerl/miller/internal/pkg/go-csv" + csv "github.com/johnkerl/miller/pkg/go-csv" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/input/record_reader_csvlite.go b/pkg/input/record_reader_csvlite.go similarity index 98% rename from internal/pkg/input/record_reader_csvlite.go rename to pkg/input/record_reader_csvlite.go index 630f786575..2220643587 100644 --- a/internal/pkg/input/record_reader_csvlite.go +++ b/pkg/input/record_reader_csvlite.go @@ -25,10 +25,10 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // recordBatchGetterCSV points to either an explicit-CSV-header or diff --git a/internal/pkg/input/record_reader_dkvp_nidx.go b/pkg/input/record_reader_dkvp_nidx.go similarity index 96% rename from internal/pkg/input/record_reader_dkvp_nidx.go rename to pkg/input/record_reader_dkvp_nidx.go index d7f83dd766..5cd92f77d0 100644 --- a/internal/pkg/input/record_reader_dkvp_nidx.go +++ b/pkg/input/record_reader_dkvp_nidx.go @@ -8,10 +8,10 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // splitter_DKVP_NIDX is a function type for the one bit of code differing diff --git a/internal/pkg/input/record_reader_dkvp_test.go b/pkg/input/record_reader_dkvp_test.go similarity index 97% rename from internal/pkg/input/record_reader_dkvp_test.go rename to pkg/input/record_reader_dkvp_test.go index 101cfc83df..77e0e557f5 100644 --- a/internal/pkg/input/record_reader_dkvp_test.go +++ b/pkg/input/record_reader_dkvp_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/johnkerl/miller/internal/pkg/cli" + "github.com/johnkerl/miller/pkg/cli" ) func TestRecordFromDKVPLine(t *testing.T) { diff --git a/internal/pkg/input/record_reader_factory.go b/pkg/input/record_reader_factory.go similarity index 95% rename from internal/pkg/input/record_reader_factory.go rename to pkg/input/record_reader_factory.go index 2a501831b5..e8328fd51f 100644 --- a/internal/pkg/input/record_reader_factory.go +++ b/pkg/input/record_reader_factory.go @@ -3,7 +3,7 @@ package input import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/cli" + "github.com/johnkerl/miller/pkg/cli" ) func Create(readerOptions *cli.TReaderOptions, recordsPerBatch int64) (IRecordReader, error) { diff --git a/internal/pkg/input/record_reader_json.go b/pkg/input/record_reader_json.go similarity index 97% rename from internal/pkg/input/record_reader_json.go rename to pkg/input/record_reader_json.go index 7cdd02fb9c..27b9b8e2c9 100644 --- a/internal/pkg/input/record_reader_json.go +++ b/pkg/input/record_reader_json.go @@ -9,10 +9,10 @@ import ( "encoding/json" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) type RecordReaderJSON struct { diff --git a/internal/pkg/input/record_reader_tsv.go b/pkg/input/record_reader_tsv.go similarity index 98% rename from internal/pkg/input/record_reader_tsv.go rename to pkg/input/record_reader_tsv.go index 7b496e7257..d3b9d75a31 100644 --- a/internal/pkg/input/record_reader_tsv.go +++ b/pkg/input/record_reader_tsv.go @@ -7,10 +7,10 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // recordBatchGetterTSV points to either an explicit-TSV-header or diff --git a/internal/pkg/input/record_reader_xtab.go b/pkg/input/record_reader_xtab.go similarity index 98% rename from internal/pkg/input/record_reader_xtab.go rename to pkg/input/record_reader_xtab.go index 1cb8ff79e3..0cfc74b25d 100644 --- a/internal/pkg/input/record_reader_xtab.go +++ b/pkg/input/record_reader_xtab.go @@ -8,10 +8,10 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) type iXTABPairSplitter interface { diff --git a/internal/pkg/lib/README.md b/pkg/lib/README.md similarity index 100% rename from internal/pkg/lib/README.md rename to pkg/lib/README.md diff --git a/internal/pkg/lib/doc.go b/pkg/lib/doc.go similarity index 100% rename from internal/pkg/lib/doc.go rename to pkg/lib/doc.go diff --git a/internal/pkg/lib/docurl.go b/pkg/lib/docurl.go similarity index 100% rename from internal/pkg/lib/docurl.go rename to pkg/lib/docurl.go diff --git a/internal/pkg/lib/file_readers.go b/pkg/lib/file_readers.go similarity index 99% rename from internal/pkg/lib/file_readers.go rename to pkg/lib/file_readers.go index 1511200406..a348ff900a 100644 --- a/internal/pkg/lib/file_readers.go +++ b/pkg/lib/file_readers.go @@ -129,7 +129,7 @@ func openPrepipedHandleForRead( // single-quote and double-quote with backslack double-quote, then wrapping the // entire result in initial and final single-quote. // -// TODO: test on Windows. Maybe needs move to internal/pkg/platform. +// TODO: test on Windows. Maybe needs move to pkg/platform. func escapeFileNameForPopen(filename string) string { var buffer bytes.Buffer foundQuote := false diff --git a/internal/pkg/lib/getoptify.go b/pkg/lib/getoptify.go similarity index 100% rename from internal/pkg/lib/getoptify.go rename to pkg/lib/getoptify.go diff --git a/internal/pkg/lib/halfpipe.go b/pkg/lib/halfpipe.go similarity index 97% rename from internal/pkg/lib/halfpipe.go rename to pkg/lib/halfpipe.go index ab8eb7f11a..276b2893b1 100644 --- a/internal/pkg/lib/halfpipe.go +++ b/pkg/lib/halfpipe.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/platform" + "github.com/johnkerl/miller/pkg/platform" ) // OpenOutboundHalfPipe returns a handle to a process. Writing to that handle diff --git a/internal/pkg/lib/latin1.go b/pkg/lib/latin1.go similarity index 100% rename from internal/pkg/lib/latin1.go rename to pkg/lib/latin1.go diff --git a/internal/pkg/lib/latin1_test.go b/pkg/lib/latin1_test.go similarity index 100% rename from internal/pkg/lib/latin1_test.go rename to pkg/lib/latin1_test.go diff --git a/internal/pkg/lib/logger.go b/pkg/lib/logger.go similarity index 100% rename from internal/pkg/lib/logger.go rename to pkg/lib/logger.go diff --git a/internal/pkg/lib/mlrmath.go b/pkg/lib/mlrmath.go similarity index 100% rename from internal/pkg/lib/mlrmath.go rename to pkg/lib/mlrmath.go diff --git a/internal/pkg/lib/ordered_map.go b/pkg/lib/ordered_map.go similarity index 100% rename from internal/pkg/lib/ordered_map.go rename to pkg/lib/ordered_map.go diff --git a/internal/pkg/lib/paragraph.go b/pkg/lib/paragraph.go similarity index 100% rename from internal/pkg/lib/paragraph.go rename to pkg/lib/paragraph.go diff --git a/internal/pkg/lib/rand.go b/pkg/lib/rand.go similarity index 100% rename from internal/pkg/lib/rand.go rename to pkg/lib/rand.go diff --git a/internal/pkg/lib/readfiles.go b/pkg/lib/readfiles.go similarity index 97% rename from internal/pkg/lib/readfiles.go rename to pkg/lib/readfiles.go index 920db7955b..53ce49cc2b 100644 --- a/internal/pkg/lib/readfiles.go +++ b/pkg/lib/readfiles.go @@ -10,7 +10,7 @@ import ( "os" "strings" - csv "github.com/johnkerl/miller/internal/pkg/go-csv" + csv "github.com/johnkerl/miller/pkg/go-csv" ) // LoadStringsFromFileOrDir calls LoadStringFromFile if path exists and is a diff --git a/internal/pkg/lib/regex.go b/pkg/lib/regex.go similarity index 100% rename from internal/pkg/lib/regex.go rename to pkg/lib/regex.go diff --git a/internal/pkg/lib/regex_test.go b/pkg/lib/regex_test.go similarity index 100% rename from internal/pkg/lib/regex_test.go rename to pkg/lib/regex_test.go diff --git a/internal/pkg/lib/stats.go b/pkg/lib/stats.go similarity index 100% rename from internal/pkg/lib/stats.go rename to pkg/lib/stats.go diff --git a/internal/pkg/lib/time.go b/pkg/lib/time.go similarity index 100% rename from internal/pkg/lib/time.go rename to pkg/lib/time.go diff --git a/internal/pkg/lib/time_test.go b/pkg/lib/time_test.go similarity index 100% rename from internal/pkg/lib/time_test.go rename to pkg/lib/time_test.go diff --git a/internal/pkg/lib/tsv_codec.go b/pkg/lib/tsv_codec.go similarity index 100% rename from internal/pkg/lib/tsv_codec.go rename to pkg/lib/tsv_codec.go diff --git a/internal/pkg/lib/tsv_codec_test.go b/pkg/lib/tsv_codec_test.go similarity index 100% rename from internal/pkg/lib/tsv_codec_test.go rename to pkg/lib/tsv_codec_test.go diff --git a/internal/pkg/lib/unbackslash.go b/pkg/lib/unbackslash.go similarity index 100% rename from internal/pkg/lib/unbackslash.go rename to pkg/lib/unbackslash.go diff --git a/internal/pkg/lib/unbackslash_test.go b/pkg/lib/unbackslash_test.go similarity index 100% rename from internal/pkg/lib/unbackslash_test.go rename to pkg/lib/unbackslash_test.go diff --git a/internal/pkg/lib/util.go b/pkg/lib/util.go similarity index 100% rename from internal/pkg/lib/util.go rename to pkg/lib/util.go diff --git a/internal/pkg/mlrval/mlrmap.go b/pkg/mlrval/mlrmap.go similarity index 100% rename from internal/pkg/mlrval/mlrmap.go rename to pkg/mlrval/mlrmap.go diff --git a/internal/pkg/mlrval/mlrmap_accessors.go b/pkg/mlrval/mlrmap_accessors.go similarity index 99% rename from internal/pkg/mlrval/mlrmap_accessors.go rename to pkg/mlrval/mlrmap_accessors.go index 9ad8e5999a..befb5f726e 100644 --- a/internal/pkg/mlrval/mlrmap_accessors.go +++ b/pkg/mlrval/mlrmap_accessors.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // IsEmpty determines if a map is empty. diff --git a/internal/pkg/mlrval/mlrmap_accessors_test.go b/pkg/mlrval/mlrmap_accessors_test.go similarity index 100% rename from internal/pkg/mlrval/mlrmap_accessors_test.go rename to pkg/mlrval/mlrmap_accessors_test.go diff --git a/internal/pkg/mlrval/mlrmap_flatten_unflatten.go b/pkg/mlrval/mlrmap_flatten_unflatten.go similarity index 99% rename from internal/pkg/mlrval/mlrmap_flatten_unflatten.go rename to pkg/mlrval/mlrmap_flatten_unflatten.go index bb91901b73..8e48ba515d 100644 --- a/internal/pkg/mlrval/mlrmap_flatten_unflatten.go +++ b/pkg/mlrval/mlrmap_flatten_unflatten.go @@ -25,7 +25,7 @@ package mlrval import ( "strings" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/mlrval/mlrmap_json.go b/pkg/mlrval/mlrmap_json.go similarity index 98% rename from internal/pkg/mlrval/mlrmap_json.go rename to pkg/mlrval/mlrmap_json.go index 726c38fb71..d185efc99b 100644 --- a/internal/pkg/mlrval/mlrmap_json.go +++ b/pkg/mlrval/mlrmap_json.go @@ -7,8 +7,8 @@ package mlrval import ( "bytes" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/mlrval/mlrmap_new_test.go b/pkg/mlrval/mlrmap_new_test.go similarity index 100% rename from internal/pkg/mlrval/mlrmap_new_test.go rename to pkg/mlrval/mlrmap_new_test.go diff --git a/internal/pkg/mlrval/mlrmap_print.go b/pkg/mlrval/mlrmap_print.go similarity index 100% rename from internal/pkg/mlrval/mlrmap_print.go rename to pkg/mlrval/mlrmap_print.go diff --git a/internal/pkg/mlrval/mlrval_accessors.go b/pkg/mlrval/mlrval_accessors.go similarity index 98% rename from internal/pkg/mlrval/mlrval_accessors.go rename to pkg/mlrval/mlrval_accessors.go index a33a2f4414..f788cc35b2 100644 --- a/internal/pkg/mlrval/mlrval_accessors.go +++ b/pkg/mlrval/mlrval_accessors.go @@ -3,7 +3,7 @@ package mlrval import ( "strconv" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) func (mv *Mlrval) GetArrayLength() (int, bool) { diff --git a/internal/pkg/mlrval/mlrval_benchmark_test.go b/pkg/mlrval/mlrval_benchmark_test.go similarity index 86% rename from internal/pkg/mlrval/mlrval_benchmark_test.go rename to pkg/mlrval/mlrval_benchmark_test.go index cb8a1f6ee4..8d7c576b2c 100644 --- a/internal/pkg/mlrval/mlrval_benchmark_test.go +++ b/pkg/mlrval/mlrval_benchmark_test.go @@ -4,7 +4,7 @@ import ( "testing" ) -// go test -run=nonesuch -bench=. github.com/johnkerl/miller/internal/pkg/mlrval/... +// go test -run=nonesuch -bench=. github.com/johnkerl/miller/pkg/mlrval/... func BenchmarkFromDeferredType(b *testing.B) { for i := 0; i < b.N; i++ { diff --git a/internal/pkg/mlrval/mlrval_cmp.go b/pkg/mlrval/mlrval_cmp.go similarity index 99% rename from internal/pkg/mlrval/mlrval_cmp.go rename to pkg/mlrval/mlrval_cmp.go index c9968d65a0..cebd3af25f 100644 --- a/internal/pkg/mlrval/mlrval_cmp.go +++ b/pkg/mlrval/mlrval_cmp.go @@ -14,7 +14,7 @@ package mlrval import ( - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) type CmpFuncBool func(input1, input2 *Mlrval) bool diff --git a/internal/pkg/mlrval/mlrval_cmp_test.go b/pkg/mlrval/mlrval_cmp_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_cmp_test.go rename to pkg/mlrval/mlrval_cmp_test.go diff --git a/internal/pkg/mlrval/mlrval_collections.go b/pkg/mlrval/mlrval_collections.go similarity index 99% rename from internal/pkg/mlrval/mlrval_collections.go rename to pkg/mlrval/mlrval_collections.go index 1e33b552bb..5f4e305a6e 100644 --- a/internal/pkg/mlrval/mlrval_collections.go +++ b/pkg/mlrval/mlrval_collections.go @@ -74,7 +74,7 @@ import ( "os" "strconv" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // ================================================================ diff --git a/internal/pkg/mlrval/mlrval_constants.go b/pkg/mlrval/mlrval_constants.go similarity index 100% rename from internal/pkg/mlrval/mlrval_constants.go rename to pkg/mlrval/mlrval_constants.go diff --git a/internal/pkg/mlrval/mlrval_copy.go b/pkg/mlrval/mlrval_copy.go similarity index 100% rename from internal/pkg/mlrval/mlrval_copy.go rename to pkg/mlrval/mlrval_copy.go diff --git a/internal/pkg/mlrval/mlrval_format.go b/pkg/mlrval/mlrval_format.go similarity index 100% rename from internal/pkg/mlrval/mlrval_format.go rename to pkg/mlrval/mlrval_format.go diff --git a/internal/pkg/mlrval/mlrval_format_test.go b/pkg/mlrval/mlrval_format_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_format_test.go rename to pkg/mlrval/mlrval_format_test.go diff --git a/internal/pkg/mlrval/mlrval_get.go b/pkg/mlrval/mlrval_get.go similarity index 98% rename from internal/pkg/mlrval/mlrval_get.go rename to pkg/mlrval/mlrval_get.go index c88d8d36a4..2eb6bfb66c 100644 --- a/internal/pkg/mlrval/mlrval_get.go +++ b/pkg/mlrval/mlrval_get.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // It's essential that we use mv.Type() not mv.mvtype, or use an Is...() diff --git a/internal/pkg/mlrval/mlrval_get_test.go b/pkg/mlrval/mlrval_get_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_get_test.go rename to pkg/mlrval/mlrval_get_test.go diff --git a/internal/pkg/mlrval/mlrval_infer.go b/pkg/mlrval/mlrval_infer.go similarity index 99% rename from internal/pkg/mlrval/mlrval_infer.go rename to pkg/mlrval/mlrval_infer.go index cf28bd260f..ada3792bd7 100644 --- a/internal/pkg/mlrval/mlrval_infer.go +++ b/pkg/mlrval/mlrval_infer.go @@ -3,7 +3,7 @@ package mlrval import ( "strconv" - "github.com/johnkerl/miller/internal/pkg/scan" + "github.com/johnkerl/miller/pkg/scan" ) // TODO: comment no infer-bool from data files. Always false in this path. diff --git a/internal/pkg/mlrval/mlrval_infer_test.go b/pkg/mlrval/mlrval_infer_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_infer_test.go rename to pkg/mlrval/mlrval_infer_test.go diff --git a/internal/pkg/mlrval/mlrval_is.go b/pkg/mlrval/mlrval_is.go similarity index 98% rename from internal/pkg/mlrval/mlrval_is.go rename to pkg/mlrval/mlrval_is.go index d1593776e5..5b3fcd9e8c 100644 --- a/internal/pkg/mlrval/mlrval_is.go +++ b/pkg/mlrval/mlrval_is.go @@ -1,7 +1,7 @@ package mlrval import ( - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // It's essential that we use mv.Type() not mv.mvtype since types are diff --git a/internal/pkg/mlrval/mlrval_is_test.go b/pkg/mlrval/mlrval_is_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_is_test.go rename to pkg/mlrval/mlrval_is_test.go diff --git a/internal/pkg/mlrval/mlrval_json.go b/pkg/mlrval/mlrval_json.go similarity index 99% rename from internal/pkg/mlrval/mlrval_json.go rename to pkg/mlrval/mlrval_json.go index 0b60d0ee59..c657815ec2 100644 --- a/internal/pkg/mlrval/mlrval_json.go +++ b/pkg/mlrval/mlrval_json.go @@ -14,8 +14,8 @@ import ( "fmt" "io" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) const JSON_INDENT_STRING string = " " diff --git a/internal/pkg/mlrval/mlrval_new.go b/pkg/mlrval/mlrval_new.go similarity index 98% rename from internal/pkg/mlrval/mlrval_new.go rename to pkg/mlrval/mlrval_new.go index 474dcb807b..eafea9afde 100644 --- a/internal/pkg/mlrval/mlrval_new.go +++ b/pkg/mlrval/mlrval_new.go @@ -8,7 +8,7 @@ import ( "errors" "fmt" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // TODO: comment for JSON-scanner context. @@ -309,7 +309,7 @@ func (mv *Mlrval) SetFromPrevalidatedBoolString(input string, boolval bool) *Mlr // The user-defined function is of type 'interface{}' here to avoid what would // otherwise be a package-dependency cycle between this package and -// github.com/johnkerl/miller/internal/pkg/dsl/cst. +// github.com/johnkerl/miller/pkg/dsl/cst. // // Nominally the name argument is the user-specified name if `func f(a, b) { // ... }`, or some autogenerated UUID like `fl0052` if `func (a, b) { ... }`. diff --git a/internal/pkg/mlrval/mlrval_new_test.go b/pkg/mlrval/mlrval_new_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_new_test.go rename to pkg/mlrval/mlrval_new_test.go diff --git a/internal/pkg/mlrval/mlrval_output.go b/pkg/mlrval/mlrval_output.go similarity index 100% rename from internal/pkg/mlrval/mlrval_output.go rename to pkg/mlrval/mlrval_output.go diff --git a/internal/pkg/mlrval/mlrval_output_test.go b/pkg/mlrval/mlrval_output_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_output_test.go rename to pkg/mlrval/mlrval_output_test.go diff --git a/internal/pkg/mlrval/mlrval_sort.go b/pkg/mlrval/mlrval_sort.go similarity index 100% rename from internal/pkg/mlrval/mlrval_sort.go rename to pkg/mlrval/mlrval_sort.go diff --git a/internal/pkg/mlrval/mlrval_sort_test.go b/pkg/mlrval/mlrval_sort_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_sort_test.go rename to pkg/mlrval/mlrval_sort_test.go diff --git a/internal/pkg/mlrval/mlrval_type.go b/pkg/mlrval/mlrval_type.go similarity index 100% rename from internal/pkg/mlrval/mlrval_type.go rename to pkg/mlrval/mlrval_type.go diff --git a/internal/pkg/mlrval/mlrval_type_test.go b/pkg/mlrval/mlrval_type_test.go similarity index 100% rename from internal/pkg/mlrval/mlrval_type_test.go rename to pkg/mlrval/mlrval_type_test.go diff --git a/internal/pkg/output/README.md b/pkg/output/README.md similarity index 100% rename from internal/pkg/output/README.md rename to pkg/output/README.md diff --git a/internal/pkg/output/channel_writer.go b/pkg/output/channel_writer.go similarity index 96% rename from internal/pkg/output/channel_writer.go rename to pkg/output/channel_writer.go index ea7ed814d1..6805ad8902 100644 --- a/internal/pkg/output/channel_writer.go +++ b/pkg/output/channel_writer.go @@ -6,8 +6,8 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) func ChannelWriter( diff --git a/internal/pkg/output/doc.go b/pkg/output/doc.go similarity index 100% rename from internal/pkg/output/doc.go rename to pkg/output/doc.go diff --git a/internal/pkg/output/file_output_handlers.go b/pkg/output/file_output_handlers.go similarity index 98% rename from internal/pkg/output/file_output_handlers.go rename to pkg/output/file_output_handlers.go index c7cf6f4839..d21cfb812b 100644 --- a/internal/pkg/output/file_output_handlers.go +++ b/pkg/output/file_output_handlers.go @@ -20,9 +20,9 @@ import ( "io" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ================================================================ diff --git a/internal/pkg/output/record_writer.go b/pkg/output/record_writer.go similarity index 92% rename from internal/pkg/output/record_writer.go rename to pkg/output/record_writer.go index 30b17badb2..37d8a7780e 100644 --- a/internal/pkg/output/record_writer.go +++ b/pkg/output/record_writer.go @@ -3,7 +3,7 @@ package output import ( "bufio" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) // IRecordWriter is the abstract interface for all record-writers. They are diff --git a/internal/pkg/output/record_writer_csv.go b/pkg/output/record_writer_csv.go similarity index 94% rename from internal/pkg/output/record_writer_csv.go rename to pkg/output/record_writer_csv.go index 076c6778c9..fd4801d29b 100644 --- a/internal/pkg/output/record_writer_csv.go +++ b/pkg/output/record_writer_csv.go @@ -5,10 +5,10 @@ import ( "fmt" "strings" - csv "github.com/johnkerl/miller/internal/pkg/go-csv" + csv "github.com/johnkerl/miller/pkg/go-csv" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterCSV struct { diff --git a/internal/pkg/output/record_writer_csv_colorizer.go b/pkg/output/record_writer_csv_colorizer.go similarity index 99% rename from internal/pkg/output/record_writer_csv_colorizer.go rename to pkg/output/record_writer_csv_colorizer.go index 43434e6439..9cb103b6a1 100644 --- a/internal/pkg/output/record_writer_csv_colorizer.go +++ b/pkg/output/record_writer_csv_colorizer.go @@ -47,7 +47,7 @@ import ( "strings" "unicode/utf8" - "github.com/johnkerl/miller/internal/pkg/colorizer" + "github.com/johnkerl/miller/pkg/colorizer" ) var errInvalidDelim = errors.New("csv: invalid field or comment delimiter") diff --git a/internal/pkg/output/record_writer_csvlite.go b/pkg/output/record_writer_csvlite.go similarity index 93% rename from internal/pkg/output/record_writer_csvlite.go rename to pkg/output/record_writer_csvlite.go index 6acf0976c3..251cf95804 100644 --- a/internal/pkg/output/record_writer_csvlite.go +++ b/pkg/output/record_writer_csvlite.go @@ -4,9 +4,9 @@ import ( "bufio" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterCSVLite struct { diff --git a/internal/pkg/output/record_writer_dkvp.go b/pkg/output/record_writer_dkvp.go similarity index 87% rename from internal/pkg/output/record_writer_dkvp.go rename to pkg/output/record_writer_dkvp.go index 6743881307..bc60868ca7 100644 --- a/internal/pkg/output/record_writer_dkvp.go +++ b/pkg/output/record_writer_dkvp.go @@ -3,9 +3,9 @@ package output import ( "bufio" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterDKVP struct { diff --git a/internal/pkg/output/record_writer_factory.go b/pkg/output/record_writer_factory.go similarity index 94% rename from internal/pkg/output/record_writer_factory.go rename to pkg/output/record_writer_factory.go index a48c68f995..b706f21bd1 100644 --- a/internal/pkg/output/record_writer_factory.go +++ b/pkg/output/record_writer_factory.go @@ -3,7 +3,7 @@ package output import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/cli" + "github.com/johnkerl/miller/pkg/cli" ) func Create(writerOptions *cli.TWriterOptions) (IRecordWriter, error) { diff --git a/internal/pkg/output/record_writer_json.go b/pkg/output/record_writer_json.go similarity index 96% rename from internal/pkg/output/record_writer_json.go rename to pkg/output/record_writer_json.go index 3ee1768525..578e9f8ba1 100644 --- a/internal/pkg/output/record_writer_json.go +++ b/pkg/output/record_writer_json.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/output/record_writer_markdown.go b/pkg/output/record_writer_markdown.go similarity index 93% rename from internal/pkg/output/record_writer_markdown.go rename to pkg/output/record_writer_markdown.go index c7bdf280dc..2688c29624 100644 --- a/internal/pkg/output/record_writer_markdown.go +++ b/pkg/output/record_writer_markdown.go @@ -4,9 +4,9 @@ import ( "bufio" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterMarkdown struct { diff --git a/internal/pkg/output/record_writer_nidx.go b/pkg/output/record_writer_nidx.go similarity index 88% rename from internal/pkg/output/record_writer_nidx.go rename to pkg/output/record_writer_nidx.go index a0e3509582..d3babd35af 100644 --- a/internal/pkg/output/record_writer_nidx.go +++ b/pkg/output/record_writer_nidx.go @@ -3,8 +3,8 @@ package output import ( "bufio" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterNIDX struct { diff --git a/internal/pkg/output/record_writer_pprint.go b/pkg/output/record_writer_pprint.go similarity index 98% rename from internal/pkg/output/record_writer_pprint.go rename to pkg/output/record_writer_pprint.go index f714e86fa3..79d49b316a 100644 --- a/internal/pkg/output/record_writer_pprint.go +++ b/pkg/output/record_writer_pprint.go @@ -7,9 +7,9 @@ import ( "strings" "unicode/utf8" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterPPRINT struct { diff --git a/internal/pkg/output/record_writer_tsv.go b/pkg/output/record_writer_tsv.go similarity index 92% rename from internal/pkg/output/record_writer_tsv.go rename to pkg/output/record_writer_tsv.go index 3a7b539531..149ac9530f 100644 --- a/internal/pkg/output/record_writer_tsv.go +++ b/pkg/output/record_writer_tsv.go @@ -5,10 +5,10 @@ import ( "fmt" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) type RecordWriterTSV struct { diff --git a/internal/pkg/output/record_writer_xtab.go b/pkg/output/record_writer_xtab.go similarity index 96% rename from internal/pkg/output/record_writer_xtab.go rename to pkg/output/record_writer_xtab.go index a13536c1e6..9093935e9a 100644 --- a/internal/pkg/output/record_writer_xtab.go +++ b/pkg/output/record_writer_xtab.go @@ -5,9 +5,9 @@ import ( "fmt" "unicode/utf8" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/parsing/README.md b/pkg/parsing/README.md similarity index 87% rename from internal/pkg/parsing/README.md rename to pkg/parsing/README.md index 58ae6926e2..161e5c75d6 100644 --- a/internal/pkg/parsing/README.md +++ b/pkg/parsing/README.md @@ -4,7 +4,7 @@ lexical/semantic grammar file for the Miller `put`/`filter` DSL framework, there would be separate `mlr.l` and `mlr.y` files; using GOCC, there is a single `mlr.bnf` file.) -All subdirectories of `internal/pkg/parsing/` are autogen code created by GOCC's +All subdirectories of `pkg/parsing/` are autogen code created by GOCC's processing of `mlr.bnf`. They are nonetheless committed to source control, since running GOCC takes quite a bit longer than the `go build` does, and the BNF file doesn't often change. (_BNF_ is for _Backus-Naur Form_ which is the @@ -12,7 +12,7 @@ phrasing of the grammar file that GOCC support.) See the top-level `miller/go` build scripts for how to rerun GOCC. As of this writing, it's ``` -gocc -o internal/pkg/parsing internal/pkg/parsing/mlr.bnf +gocc -o pkg/parsing pkg/parsing/mlr.bnf ```` as invoked from the repo base directory -- however you should instead use diff --git a/internal/pkg/parsing/doc.go b/pkg/parsing/doc.go similarity index 100% rename from internal/pkg/parsing/doc.go rename to pkg/parsing/doc.go diff --git a/internal/pkg/parsing/errors.go.template b/pkg/parsing/errors.go.template similarity index 92% rename from internal/pkg/parsing/errors.go.template rename to pkg/parsing/errors.go.template index da89c0bacf..5c39ede1d4 100644 --- a/internal/pkg/parsing/errors.go.template +++ b/pkg/parsing/errors.go.template @@ -3,8 +3,8 @@ // over the top of GOCC codegen so that we can customize handling of error // messages. // -// Source: internal/pkg/parsing/errors.go.template -// Destination: internal/pkg/parsing/errors/errors.go +// Source: pkg/parsing/errors.go.template +// Destination: pkg/parsing/errors/errors.go // ================================================================ package errors @@ -13,7 +13,7 @@ import ( "fmt" "strings" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/parsing/token" ) type ErrorSymbol interface { diff --git a/internal/pkg/parsing/errors/doc.go b/pkg/parsing/errors/doc.go similarity index 68% rename from internal/pkg/parsing/errors/doc.go rename to pkg/parsing/errors/doc.go index b3a2ff9c71..2d1f13f3f1 100644 --- a/internal/pkg/parsing/errors/doc.go +++ b/pkg/parsing/errors/doc.go @@ -1,3 +1,3 @@ // Package errors contains source code autogenerated by GOCC from the Miller DSL's -// grammar file internal/pkg/parsing/mlr.bnf. +// grammar file pkg/parsing/mlr.bnf. package errors diff --git a/internal/pkg/parsing/errors/errors.go b/pkg/parsing/errors/errors.go similarity index 92% rename from internal/pkg/parsing/errors/errors.go rename to pkg/parsing/errors/errors.go index da89c0bacf..5c39ede1d4 100644 --- a/internal/pkg/parsing/errors/errors.go +++ b/pkg/parsing/errors/errors.go @@ -3,8 +3,8 @@ // over the top of GOCC codegen so that we can customize handling of error // messages. // -// Source: internal/pkg/parsing/errors.go.template -// Destination: internal/pkg/parsing/errors/errors.go +// Source: pkg/parsing/errors.go.template +// Destination: pkg/parsing/errors/errors.go // ================================================================ package errors @@ -13,7 +13,7 @@ import ( "fmt" "strings" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/parsing/token" ) type ErrorSymbol interface { diff --git a/internal/pkg/parsing/lexer/acttab.go b/pkg/parsing/lexer/acttab.go similarity index 99% rename from internal/pkg/parsing/lexer/acttab.go rename to pkg/parsing/lexer/acttab.go index 0809367663..18917879fb 100644 --- a/internal/pkg/parsing/lexer/acttab.go +++ b/pkg/parsing/lexer/acttab.go @@ -5,7 +5,7 @@ package lexer import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/parsing/token" ) type ActionTable [NumStates]ActionRow diff --git a/internal/pkg/parsing/lexer/doc.go b/pkg/parsing/lexer/doc.go similarity index 67% rename from internal/pkg/parsing/lexer/doc.go rename to pkg/parsing/lexer/doc.go index 8381497d42..ed55d4bd2d 100644 --- a/internal/pkg/parsing/lexer/doc.go +++ b/pkg/parsing/lexer/doc.go @@ -1,3 +1,3 @@ // Package lexer contains source code autogenerated by GOCC from the Miller DSL's -// grammar file internal/pkg/parsing/mlr.bnf. +// grammar file pkg/parsing/mlr.bnf. package lexer diff --git a/internal/pkg/parsing/lexer/lexer.go b/pkg/parsing/lexer/lexer.go similarity index 99% rename from internal/pkg/parsing/lexer/lexer.go rename to pkg/parsing/lexer/lexer.go index 18fd8ea7a1..d106a08a30 100644 --- a/internal/pkg/parsing/lexer/lexer.go +++ b/pkg/parsing/lexer/lexer.go @@ -6,7 +6,7 @@ import ( "os" "unicode/utf8" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + "github.com/johnkerl/miller/pkg/parsing/token" ) const ( diff --git a/internal/pkg/parsing/lexer/transitiontable.go b/pkg/parsing/lexer/transitiontable.go similarity index 100% rename from internal/pkg/parsing/lexer/transitiontable.go rename to pkg/parsing/lexer/transitiontable.go diff --git a/internal/pkg/parsing/mlr.bnf b/pkg/parsing/mlr.bnf similarity index 99% rename from internal/pkg/parsing/mlr.bnf rename to pkg/parsing/mlr.bnf index 6f987c827b..39d6c0c3b7 100644 --- a/internal/pkg/parsing/mlr.bnf +++ b/pkg/parsing/mlr.bnf @@ -42,7 +42,7 @@ // interface{}/error since they are meant for nesting as arguments here // within this file. // -// * Please see internal/pkg/dsl/ast*.go for more about what the <<...>> +// * Please see pkg/dsl/ast*.go for more about what the <<...>> // code here is calling. // ================================================================ @@ -347,7 +347,7 @@ panic : '%' '%' '%' 'p' 'a' 'n' 'i' 'c' '%' '%' '%' ; // ================================================================ // Import the AST/ASTNode types and functions -<< import "github.com/johnkerl/miller/internal/pkg/dsl" >> +<< import "github.com/johnkerl/miller/pkg/dsl" >> // ================================================================ // TOP-LEVEL PRODUCTION RULE FOR THE MILLER DSL diff --git a/internal/pkg/parsing/parser/action.go b/pkg/parsing/parser/action.go similarity index 100% rename from internal/pkg/parsing/parser/action.go rename to pkg/parsing/parser/action.go diff --git a/internal/pkg/parsing/parser/actiontable.go b/pkg/parsing/parser/actiontable.go similarity index 100% rename from internal/pkg/parsing/parser/actiontable.go rename to pkg/parsing/parser/actiontable.go diff --git a/internal/pkg/parsing/parser/context.go b/pkg/parsing/parser/context.go similarity index 100% rename from internal/pkg/parsing/parser/context.go rename to pkg/parsing/parser/context.go diff --git a/internal/pkg/parsing/parser/doc.go b/pkg/parsing/parser/doc.go similarity index 68% rename from internal/pkg/parsing/parser/doc.go rename to pkg/parsing/parser/doc.go index e67ea07a58..031a6d91cc 100644 --- a/internal/pkg/parsing/parser/doc.go +++ b/pkg/parsing/parser/doc.go @@ -1,3 +1,3 @@ // Package parser contains source code autogenerated by GOCC from the Miller DSL's -// grammar file internal/pkg/parsing/mlr.bnf. +// grammar file pkg/parsing/mlr.bnf. package parser diff --git a/internal/pkg/parsing/parser/gototable.go b/pkg/parsing/parser/gototable.go similarity index 100% rename from internal/pkg/parsing/parser/gototable.go rename to pkg/parsing/parser/gototable.go diff --git a/internal/pkg/parsing/parser/parser.go b/pkg/parsing/parser/parser.go similarity index 97% rename from internal/pkg/parsing/parser/parser.go rename to pkg/parsing/parser/parser.go index 8402d1bedc..444e9f4952 100644 --- a/internal/pkg/parsing/parser/parser.go +++ b/pkg/parsing/parser/parser.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - parseError "github.com/johnkerl/miller/internal/pkg/parsing/errors" - "github.com/johnkerl/miller/internal/pkg/parsing/token" + parseError "github.com/johnkerl/miller/pkg/parsing/errors" + "github.com/johnkerl/miller/pkg/parsing/token" ) const ( diff --git a/internal/pkg/parsing/parser/productionstable.go b/pkg/parsing/parser/productionstable.go similarity index 99% rename from internal/pkg/parsing/parser/productionstable.go rename to pkg/parsing/parser/productionstable.go index bd84651b20..f4b61fd50c 100644 --- a/internal/pkg/parsing/parser/productionstable.go +++ b/pkg/parsing/parser/productionstable.go @@ -2,7 +2,7 @@ package parser -import "github.com/johnkerl/miller/internal/pkg/dsl" +import "github.com/johnkerl/miller/pkg/dsl" type ( ProdTab [numProductions]ProdTabEntry diff --git a/internal/pkg/parsing/token/context.go b/pkg/parsing/token/context.go similarity index 100% rename from internal/pkg/parsing/token/context.go rename to pkg/parsing/token/context.go diff --git a/internal/pkg/parsing/token/doc.go b/pkg/parsing/token/doc.go similarity index 67% rename from internal/pkg/parsing/token/doc.go rename to pkg/parsing/token/doc.go index a41d418166..77899ed79e 100644 --- a/internal/pkg/parsing/token/doc.go +++ b/pkg/parsing/token/doc.go @@ -1,3 +1,3 @@ // Package token contains source code autogenerated by GOCC from the Miller DSL's -// grammar file internal/pkg/parsing/mlr.bnf. +// grammar file pkg/parsing/mlr.bnf. package token diff --git a/internal/pkg/parsing/token/token.go b/pkg/parsing/token/token.go similarity index 100% rename from internal/pkg/parsing/token/token.go rename to pkg/parsing/token/token.go diff --git a/internal/pkg/parsing/util/doc.go b/pkg/parsing/util/doc.go similarity index 67% rename from internal/pkg/parsing/util/doc.go rename to pkg/parsing/util/doc.go index af6cd78c2a..1a61fda122 100644 --- a/internal/pkg/parsing/util/doc.go +++ b/pkg/parsing/util/doc.go @@ -1,3 +1,3 @@ // Package util contains source code autogenerated by GOCC from the Miller DSL's -// grammar file internal/pkg/parsing/mlr.bnf. +// grammar file pkg/parsing/mlr.bnf. package util diff --git a/internal/pkg/parsing/util/litconv.go b/pkg/parsing/util/litconv.go similarity index 100% rename from internal/pkg/parsing/util/litconv.go rename to pkg/parsing/util/litconv.go diff --git a/internal/pkg/parsing/util/rune.go b/pkg/parsing/util/rune.go similarity index 100% rename from internal/pkg/parsing/util/rune.go rename to pkg/parsing/util/rune.go diff --git a/internal/pkg/pbnjay-strptime/README.md b/pkg/pbnjay-strptime/README.md similarity index 100% rename from internal/pkg/pbnjay-strptime/README.md rename to pkg/pbnjay-strptime/README.md diff --git a/internal/pkg/pbnjay-strptime/strptime.go b/pkg/pbnjay-strptime/strptime.go similarity index 100% rename from internal/pkg/pbnjay-strptime/strptime.go rename to pkg/pbnjay-strptime/strptime.go diff --git a/internal/pkg/pbnjay-strptime/strptime_test.go b/pkg/pbnjay-strptime/strptime_test.go similarity index 100% rename from internal/pkg/pbnjay-strptime/strptime_test.go rename to pkg/pbnjay-strptime/strptime_test.go diff --git a/internal/pkg/platform/README.md b/pkg/platform/README.md similarity index 100% rename from internal/pkg/platform/README.md rename to pkg/platform/README.md diff --git a/internal/pkg/platform/diff_notwindows.go b/pkg/platform/diff_notwindows.go similarity index 100% rename from internal/pkg/platform/diff_notwindows.go rename to pkg/platform/diff_notwindows.go diff --git a/internal/pkg/platform/diff_windows.go b/pkg/platform/diff_windows.go similarity index 100% rename from internal/pkg/platform/diff_windows.go rename to pkg/platform/diff_windows.go diff --git a/internal/pkg/platform/doc.go b/pkg/platform/doc.go similarity index 100% rename from internal/pkg/platform/doc.go rename to pkg/platform/doc.go diff --git a/internal/pkg/platform/getargs_notwindows.go b/pkg/platform/getargs_notwindows.go similarity index 100% rename from internal/pkg/platform/getargs_notwindows.go rename to pkg/platform/getargs_notwindows.go diff --git a/internal/pkg/platform/getargs_windows.go b/pkg/platform/getargs_windows.go similarity index 100% rename from internal/pkg/platform/getargs_windows.go rename to pkg/platform/getargs_windows.go diff --git a/internal/pkg/platform/shellrun_notwindows.go b/pkg/platform/shellrun_notwindows.go similarity index 100% rename from internal/pkg/platform/shellrun_notwindows.go rename to pkg/platform/shellrun_notwindows.go diff --git a/internal/pkg/platform/shellrun_windows.go b/pkg/platform/shellrun_windows.go similarity index 100% rename from internal/pkg/platform/shellrun_windows.go rename to pkg/platform/shellrun_windows.go diff --git a/internal/pkg/platform/terminal_notwindows.go b/pkg/platform/terminal_notwindows.go similarity index 100% rename from internal/pkg/platform/terminal_notwindows.go rename to pkg/platform/terminal_notwindows.go diff --git a/internal/pkg/platform/terminal_windows.go b/pkg/platform/terminal_windows.go similarity index 100% rename from internal/pkg/platform/terminal_windows.go rename to pkg/platform/terminal_windows.go diff --git a/internal/pkg/runtime/README.md b/pkg/runtime/README.md similarity index 100% rename from internal/pkg/runtime/README.md rename to pkg/runtime/README.md diff --git a/internal/pkg/runtime/doc.go b/pkg/runtime/doc.go similarity index 100% rename from internal/pkg/runtime/doc.go rename to pkg/runtime/doc.go diff --git a/internal/pkg/runtime/stack.go b/pkg/runtime/stack.go similarity index 98% rename from internal/pkg/runtime/stack.go rename to pkg/runtime/stack.go index a5cf2499ef..b32cd06dd3 100644 --- a/internal/pkg/runtime/stack.go +++ b/pkg/runtime/stack.go @@ -29,9 +29,9 @@ import ( "container/list" "fmt" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ================================================================ diff --git a/internal/pkg/runtime/state.go b/pkg/runtime/state.go similarity index 89% rename from internal/pkg/runtime/state.go rename to pkg/runtime/state.go index 8c3a6caca4..e94fd4ce5f 100644 --- a/internal/pkg/runtime/state.go +++ b/pkg/runtime/state.go @@ -9,10 +9,10 @@ package runtime import ( "container/list" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) type State struct { diff --git a/internal/pkg/scan/digits.go b/pkg/scan/digits.go similarity index 100% rename from internal/pkg/scan/digits.go rename to pkg/scan/digits.go diff --git a/internal/pkg/scan/digits_test.go b/pkg/scan/digits_test.go similarity index 100% rename from internal/pkg/scan/digits_test.go rename to pkg/scan/digits_test.go diff --git a/internal/pkg/scan/doc.go b/pkg/scan/doc.go similarity index 100% rename from internal/pkg/scan/doc.go rename to pkg/scan/doc.go diff --git a/internal/pkg/scan/find.go b/pkg/scan/find.go similarity index 100% rename from internal/pkg/scan/find.go rename to pkg/scan/find.go diff --git a/internal/pkg/scan/find_benchmark_test.go b/pkg/scan/find_benchmark_test.go similarity index 94% rename from internal/pkg/scan/find_benchmark_test.go rename to pkg/scan/find_benchmark_test.go index 0d023a25fa..e905bb7357 100644 --- a/internal/pkg/scan/find_benchmark_test.go +++ b/pkg/scan/find_benchmark_test.go @@ -4,7 +4,7 @@ import ( "testing" ) -// go test -run=nonesuch -bench=. github.com/johnkerl/miller/internal/pkg/scan/... +// go test -run=nonesuch -bench=. github.com/johnkerl/miller/pkg/scan/... func BenchmarkFromNormalCases(b *testing.B) { diff --git a/internal/pkg/scan/find_test.go b/pkg/scan/find_test.go similarity index 100% rename from internal/pkg/scan/find_test.go rename to pkg/scan/find_test.go diff --git a/internal/pkg/scan/type.go b/pkg/scan/type.go similarity index 100% rename from internal/pkg/scan/type.go rename to pkg/scan/type.go diff --git a/internal/pkg/scan/type_test.go b/pkg/scan/type_test.go similarity index 100% rename from internal/pkg/scan/type_test.go rename to pkg/scan/type_test.go diff --git a/internal/pkg/stream/README.md b/pkg/stream/README.md similarity index 100% rename from internal/pkg/stream/README.md rename to pkg/stream/README.md diff --git a/internal/pkg/stream/doc.go b/pkg/stream/doc.go similarity index 100% rename from internal/pkg/stream/doc.go rename to pkg/stream/doc.go diff --git a/internal/pkg/stream/stream.go b/pkg/stream/stream.go similarity index 94% rename from internal/pkg/stream/stream.go rename to pkg/stream/stream.go index 351eda06dd..9f2cbe805c 100644 --- a/internal/pkg/stream/stream.go +++ b/pkg/stream/stream.go @@ -6,11 +6,11 @@ import ( "errors" "io" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/input" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/transformers" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/input" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/transformers" + "github.com/johnkerl/miller/pkg/types" ) // Since Go is concurrent, the context struct (AWK-like variables such as diff --git a/internal/pkg/terminals/doc.go b/pkg/terminals/doc.go similarity index 100% rename from internal/pkg/terminals/doc.go rename to pkg/terminals/doc.go diff --git a/internal/pkg/terminals/help/doc.go b/pkg/terminals/help/doc.go similarity index 100% rename from internal/pkg/terminals/help/doc.go rename to pkg/terminals/help/doc.go diff --git a/internal/pkg/terminals/help/entry.go b/pkg/terminals/help/entry.go similarity index 98% rename from internal/pkg/terminals/help/entry.go rename to pkg/terminals/help/entry.go index 6598c48b31..3b25b58b52 100644 --- a/internal/pkg/terminals/help/entry.go +++ b/pkg/terminals/help/entry.go @@ -10,13 +10,13 @@ import ( "github.com/mattn/go-isatty" - "github.com/johnkerl/miller/internal/pkg/auxents" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl/cst" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers" + "github.com/johnkerl/miller/pkg/auxents" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl/cst" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers" ) // ================================================================ diff --git a/internal/pkg/terminals/regtest/README.md b/pkg/terminals/regtest/README.md similarity index 100% rename from internal/pkg/terminals/regtest/README.md rename to pkg/terminals/regtest/README.md diff --git a/internal/pkg/terminals/regtest/doc.go b/pkg/terminals/regtest/doc.go similarity index 100% rename from internal/pkg/terminals/regtest/doc.go rename to pkg/terminals/regtest/doc.go diff --git a/internal/pkg/terminals/regtest/entry.go b/pkg/terminals/regtest/entry.go similarity index 100% rename from internal/pkg/terminals/regtest/entry.go rename to pkg/terminals/regtest/entry.go diff --git a/internal/pkg/terminals/regtest/invoker.go b/pkg/terminals/regtest/invoker.go similarity index 97% rename from internal/pkg/terminals/regtest/invoker.go rename to pkg/terminals/regtest/invoker.go index a1cf4a921e..febbbbfa38 100644 --- a/internal/pkg/terminals/regtest/invoker.go +++ b/pkg/terminals/regtest/invoker.go @@ -6,8 +6,8 @@ import ( "os/exec" "strings" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/platform" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/platform" ) // RunMillerCommand runs a string like 'mlr cat foo.dat', with specified mlr diff --git a/internal/pkg/terminals/regtest/regtester.go b/pkg/terminals/regtest/regtester.go similarity index 99% rename from internal/pkg/terminals/regtest/regtester.go rename to pkg/terminals/regtest/regtester.go index 34550053b4..ec58bdf733 100644 --- a/internal/pkg/terminals/regtest/regtester.go +++ b/pkg/terminals/regtest/regtester.go @@ -64,8 +64,8 @@ import ( "runtime" "strings" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) const CmdName = "cmd" diff --git a/internal/pkg/terminals/repl/README.md b/pkg/terminals/repl/README.md similarity index 100% rename from internal/pkg/terminals/repl/README.md rename to pkg/terminals/repl/README.md diff --git a/internal/pkg/terminals/repl/doc.go b/pkg/terminals/repl/doc.go similarity index 100% rename from internal/pkg/terminals/repl/doc.go rename to pkg/terminals/repl/doc.go diff --git a/internal/pkg/terminals/repl/dsl.go b/pkg/terminals/repl/dsl.go similarity index 96% rename from internal/pkg/terminals/repl/dsl.go rename to pkg/terminals/repl/dsl.go index 87d6500f07..8f3a2a0469 100644 --- a/internal/pkg/terminals/repl/dsl.go +++ b/pkg/terminals/repl/dsl.go @@ -23,9 +23,9 @@ import ( "fmt" "strings" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/dsl/cst" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/dsl/cst" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/terminals/repl/entry.go b/pkg/terminals/repl/entry.go similarity index 99% rename from internal/pkg/terminals/repl/entry.go rename to pkg/terminals/repl/entry.go index 28f873fd71..d2403ccdfa 100644 --- a/internal/pkg/terminals/repl/entry.go +++ b/pkg/terminals/repl/entry.go @@ -27,7 +27,7 @@ import ( "path" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" + "github.com/johnkerl/miller/pkg/cli" ) // ================================================================ diff --git a/internal/pkg/terminals/repl/prompt.go b/pkg/terminals/repl/prompt.go similarity index 92% rename from internal/pkg/terminals/repl/prompt.go rename to pkg/terminals/repl/prompt.go index 7c03418813..bfcb46d2c5 100644 --- a/internal/pkg/terminals/repl/prompt.go +++ b/pkg/terminals/repl/prompt.go @@ -11,9 +11,9 @@ import ( "golang.org/x/term" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/version" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/version" ) const ENV_PRIMARY_PROMPT = "MLR_REPL_PS1" diff --git a/internal/pkg/terminals/repl/session.go b/pkg/terminals/repl/session.go similarity index 94% rename from internal/pkg/terminals/repl/session.go rename to pkg/terminals/repl/session.go index 98b77aa740..03ef0f6b40 100644 --- a/internal/pkg/terminals/repl/session.go +++ b/pkg/terminals/repl/session.go @@ -25,14 +25,14 @@ import ( "strings" "syscall" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl/cst" - "github.com/johnkerl/miller/internal/pkg/input" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl/cst" + "github.com/johnkerl/miller/pkg/input" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/terminals/repl/types.go b/pkg/terminals/repl/types.go similarity index 88% rename from internal/pkg/terminals/repl/types.go rename to pkg/terminals/repl/types.go index ea20658a67..b0da1b9d36 100644 --- a/internal/pkg/terminals/repl/types.go +++ b/pkg/terminals/repl/types.go @@ -9,11 +9,11 @@ import ( "container/list" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl/cst" - "github.com/johnkerl/miller/internal/pkg/input" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/runtime" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl/cst" + "github.com/johnkerl/miller/pkg/input" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/runtime" ) // ================================================================ diff --git a/internal/pkg/terminals/repl/verbs.go b/pkg/terminals/repl/verbs.go similarity index 99% rename from internal/pkg/terminals/repl/verbs.go rename to pkg/terminals/repl/verbs.go index a47e93d53c..92d9046fff 100644 --- a/internal/pkg/terminals/repl/verbs.go +++ b/pkg/terminals/repl/verbs.go @@ -10,12 +10,12 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/dsl/cst" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/dsl/cst" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/terminals/terminals.go b/pkg/terminals/terminals.go similarity index 90% rename from internal/pkg/terminals/terminals.go rename to pkg/terminals/terminals.go index 91f0fecf44..78ec0dd3f1 100644 --- a/internal/pkg/terminals/terminals.go +++ b/pkg/terminals/terminals.go @@ -10,10 +10,10 @@ import ( "os" "runtime" - "github.com/johnkerl/miller/internal/pkg/terminals/help" - "github.com/johnkerl/miller/internal/pkg/terminals/regtest" - "github.com/johnkerl/miller/internal/pkg/terminals/repl" - "github.com/johnkerl/miller/internal/pkg/version" + "github.com/johnkerl/miller/pkg/terminals/help" + "github.com/johnkerl/miller/pkg/terminals/regtest" + "github.com/johnkerl/miller/pkg/terminals/repl" + "github.com/johnkerl/miller/pkg/version" ) // tTerminalMain is a function-pointer type for the entrypoint handler for a given terminal, diff --git a/internal/pkg/transformers/README.md b/pkg/transformers/README.md similarity index 100% rename from internal/pkg/transformers/README.md rename to pkg/transformers/README.md diff --git a/internal/pkg/transformers/aaa_chain_transformer.go b/pkg/transformers/aaa_chain_transformer.go similarity index 99% rename from internal/pkg/transformers/aaa_chain_transformer.go rename to pkg/transformers/aaa_chain_transformer.go index 81e954e509..e367ab8834 100644 --- a/internal/pkg/transformers/aaa_chain_transformer.go +++ b/pkg/transformers/aaa_chain_transformer.go @@ -3,8 +3,8 @@ package transformers import ( "container/list" "fmt" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" "os" ) diff --git a/internal/pkg/transformers/aaa_record_transformer.go b/pkg/transformers/aaa_record_transformer.go similarity index 95% rename from internal/pkg/transformers/aaa_record_transformer.go rename to pkg/transformers/aaa_record_transformer.go index 4a8dfaa43d..1f9bae7dd6 100644 --- a/internal/pkg/transformers/aaa_record_transformer.go +++ b/pkg/transformers/aaa_record_transformer.go @@ -4,8 +4,8 @@ import ( "container/list" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // IRecordTransformer is the interface satisfied by all transformers, i.e., diff --git a/internal/pkg/transformers/aaa_transformer_table.go b/pkg/transformers/aaa_transformer_table.go similarity index 96% rename from internal/pkg/transformers/aaa_transformer_table.go rename to pkg/transformers/aaa_transformer_table.go index ece90a8584..ed98af07f2 100644 --- a/internal/pkg/transformers/aaa_transformer_table.go +++ b/pkg/transformers/aaa_transformer_table.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/colorizer" - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/colorizer" + "github.com/johnkerl/miller/pkg/lib" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/altkv.go b/pkg/transformers/altkv.go similarity index 95% rename from internal/pkg/transformers/altkv.go rename to pkg/transformers/altkv.go index af3c4f02b1..a97c3127e4 100644 --- a/internal/pkg/transformers/altkv.go +++ b/pkg/transformers/altkv.go @@ -7,9 +7,9 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/bar.go b/pkg/transformers/bar.go similarity index 98% rename from internal/pkg/transformers/bar.go rename to pkg/transformers/bar.go index d7157da54b..0aaafd8f17 100644 --- a/internal/pkg/transformers/bar.go +++ b/pkg/transformers/bar.go @@ -7,9 +7,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) const barDefaultFillString = "*" diff --git a/internal/pkg/transformers/bootstrap.go b/pkg/transformers/bootstrap.go similarity index 97% rename from internal/pkg/transformers/bootstrap.go rename to pkg/transformers/bootstrap.go index 8447fb171a..9450a425e8 100644 --- a/internal/pkg/transformers/bootstrap.go +++ b/pkg/transformers/bootstrap.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/case.go b/pkg/transformers/case.go similarity index 97% rename from internal/pkg/transformers/case.go rename to pkg/transformers/case.go index f25a68f965..4d02617c4d 100644 --- a/internal/pkg/transformers/case.go +++ b/pkg/transformers/case.go @@ -9,10 +9,10 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/cat.go b/pkg/transformers/cat.go similarity index 97% rename from internal/pkg/transformers/cat.go rename to pkg/transformers/cat.go index 045b57a738..c065aa5366 100644 --- a/internal/pkg/transformers/cat.go +++ b/pkg/transformers/cat.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/check.go b/pkg/transformers/check.go similarity index 97% rename from internal/pkg/transformers/check.go rename to pkg/transformers/check.go index 0301dad7df..9f36001901 100644 --- a/internal/pkg/transformers/check.go +++ b/pkg/transformers/check.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/clean_whitespace.go b/pkg/transformers/clean_whitespace.go similarity index 96% rename from internal/pkg/transformers/clean_whitespace.go rename to pkg/transformers/clean_whitespace.go index c5c9bf51cd..3ffdd3862e 100644 --- a/internal/pkg/transformers/clean_whitespace.go +++ b/pkg/transformers/clean_whitespace.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/count.go b/pkg/transformers/count.go similarity index 97% rename from internal/pkg/transformers/count.go rename to pkg/transformers/count.go index 91c73ee0d4..623855ac9c 100644 --- a/internal/pkg/transformers/count.go +++ b/pkg/transformers/count.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/count_similar.go b/pkg/transformers/count_similar.go similarity index 95% rename from internal/pkg/transformers/count_similar.go rename to pkg/transformers/count_similar.go index 9707216de9..2fafe2d706 100644 --- a/internal/pkg/transformers/count_similar.go +++ b/pkg/transformers/count_similar.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/cut.go b/pkg/transformers/cut.go similarity index 97% rename from internal/pkg/transformers/cut.go rename to pkg/transformers/cut.go index 35c22bbcd5..f3039f65aa 100644 --- a/internal/pkg/transformers/cut.go +++ b/pkg/transformers/cut.go @@ -7,10 +7,10 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/decimate.go b/pkg/transformers/decimate.go similarity index 97% rename from internal/pkg/transformers/decimate.go rename to pkg/transformers/decimate.go index 9446c05022..8535c1d4bc 100644 --- a/internal/pkg/transformers/decimate.go +++ b/pkg/transformers/decimate.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/doc.go b/pkg/transformers/doc.go similarity index 100% rename from internal/pkg/transformers/doc.go rename to pkg/transformers/doc.go diff --git a/internal/pkg/transformers/fill_down.go b/pkg/transformers/fill_down.go similarity index 97% rename from internal/pkg/transformers/fill_down.go rename to pkg/transformers/fill_down.go index 88b78ef9bc..b9ab079dc2 100644 --- a/internal/pkg/transformers/fill_down.go +++ b/pkg/transformers/fill_down.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/fill_empty.go b/pkg/transformers/fill_empty.go similarity index 95% rename from internal/pkg/transformers/fill_empty.go rename to pkg/transformers/fill_empty.go index 1b6f931933..e893ef3345 100644 --- a/internal/pkg/transformers/fill_empty.go +++ b/pkg/transformers/fill_empty.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/flatten.go b/pkg/transformers/flatten.go similarity index 97% rename from internal/pkg/transformers/flatten.go rename to pkg/transformers/flatten.go index 479df8a9cb..a2f4d1a979 100644 --- a/internal/pkg/transformers/flatten.go +++ b/pkg/transformers/flatten.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/format_values.go b/pkg/transformers/format_values.go similarity index 97% rename from internal/pkg/transformers/format_values.go rename to pkg/transformers/format_values.go index fc0372e83c..d91041c27e 100644 --- a/internal/pkg/transformers/format_values.go +++ b/pkg/transformers/format_values.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/fraction.go b/pkg/transformers/fraction.go similarity index 97% rename from internal/pkg/transformers/fraction.go rename to pkg/transformers/fraction.go index 9327ce2088..fb90ab2bf2 100644 --- a/internal/pkg/transformers/fraction.go +++ b/pkg/transformers/fraction.go @@ -7,11 +7,11 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/gap.go b/pkg/transformers/gap.go similarity index 97% rename from internal/pkg/transformers/gap.go rename to pkg/transformers/gap.go index 2a8e8536c6..345780f4e6 100644 --- a/internal/pkg/transformers/gap.go +++ b/pkg/transformers/gap.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/grep.go b/pkg/transformers/grep.go similarity index 97% rename from internal/pkg/transformers/grep.go rename to pkg/transformers/grep.go index 5f3f217fd8..6e8c8f183f 100644 --- a/internal/pkg/transformers/grep.go +++ b/pkg/transformers/grep.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/group_by.go b/pkg/transformers/group_by.go similarity index 96% rename from internal/pkg/transformers/group_by.go rename to pkg/transformers/group_by.go index aa51e3bd05..f210969ada 100644 --- a/internal/pkg/transformers/group_by.go +++ b/pkg/transformers/group_by.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/group_like.go b/pkg/transformers/group_like.go similarity index 95% rename from internal/pkg/transformers/group_like.go rename to pkg/transformers/group_like.go index 860ae8b805..a7ede9a59a 100644 --- a/internal/pkg/transformers/group_like.go +++ b/pkg/transformers/group_like.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/gsub.go b/pkg/transformers/gsub.go similarity index 94% rename from internal/pkg/transformers/gsub.go rename to pkg/transformers/gsub.go index 550aeda5af..0b188505bb 100644 --- a/internal/pkg/transformers/gsub.go +++ b/pkg/transformers/gsub.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/having_fields.go b/pkg/transformers/having_fields.go similarity index 98% rename from internal/pkg/transformers/having_fields.go rename to pkg/transformers/having_fields.go index 1a8442a8b8..b17e6cecca 100644 --- a/internal/pkg/transformers/having_fields.go +++ b/pkg/transformers/having_fields.go @@ -7,9 +7,9 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) type tHavingFieldsCriterion int diff --git a/internal/pkg/transformers/head.go b/pkg/transformers/head.go similarity index 98% rename from internal/pkg/transformers/head.go rename to pkg/transformers/head.go index 3209db5b28..4626ddeade 100644 --- a/internal/pkg/transformers/head.go +++ b/pkg/transformers/head.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/histogram.go b/pkg/transformers/histogram.go similarity index 98% rename from internal/pkg/transformers/histogram.go rename to pkg/transformers/histogram.go index 39ae3aa62c..a7d6241fbf 100644 --- a/internal/pkg/transformers/histogram.go +++ b/pkg/transformers/histogram.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/join.go b/pkg/transformers/join.go similarity index 98% rename from internal/pkg/transformers/join.go rename to pkg/transformers/join.go index 51c73cccb5..3d8547a126 100644 --- a/internal/pkg/transformers/join.go +++ b/pkg/transformers/join.go @@ -6,12 +6,12 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/input" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/input" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/json_parse.go b/pkg/transformers/json_parse.go similarity index 97% rename from internal/pkg/transformers/json_parse.go rename to pkg/transformers/json_parse.go index 64904a653e..1a00ccf080 100644 --- a/internal/pkg/transformers/json_parse.go +++ b/pkg/transformers/json_parse.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/json_stringify.go b/pkg/transformers/json_stringify.go similarity index 96% rename from internal/pkg/transformers/json_stringify.go rename to pkg/transformers/json_stringify.go index 71e3d4d76e..ca515f0a0d 100644 --- a/internal/pkg/transformers/json_stringify.go +++ b/pkg/transformers/json_stringify.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/label.go b/pkg/transformers/label.go similarity index 95% rename from internal/pkg/transformers/label.go rename to pkg/transformers/label.go index 876aeb7b09..b14be1b6d9 100644 --- a/internal/pkg/transformers/label.go +++ b/pkg/transformers/label.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/latin1_to_utf8.go b/pkg/transformers/latin1_to_utf8.go similarity index 93% rename from internal/pkg/transformers/latin1_to_utf8.go rename to pkg/transformers/latin1_to_utf8.go index 0783b62794..b3dca48b55 100644 --- a/internal/pkg/transformers/latin1_to_utf8.go +++ b/pkg/transformers/latin1_to_utf8.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/merge_fields.go b/pkg/transformers/merge_fields.go similarity index 98% rename from internal/pkg/transformers/merge_fields.go rename to pkg/transformers/merge_fields.go index fe48d5e8dc..de1a555c3d 100644 --- a/internal/pkg/transformers/merge_fields.go +++ b/pkg/transformers/merge_fields.go @@ -7,10 +7,10 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/most_or_least_frequent.go b/pkg/transformers/most_or_least_frequent.go similarity index 97% rename from internal/pkg/transformers/most_or_least_frequent.go rename to pkg/transformers/most_or_least_frequent.go index 2e58999ebd..1381e81d95 100644 --- a/internal/pkg/transformers/most_or_least_frequent.go +++ b/pkg/transformers/most_or_least_frequent.go @@ -7,10 +7,10 @@ import ( "sort" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/nest.go b/pkg/transformers/nest.go similarity index 98% rename from internal/pkg/transformers/nest.go rename to pkg/transformers/nest.go index c8e98d4868..bced869df8 100644 --- a/internal/pkg/transformers/nest.go +++ b/pkg/transformers/nest.go @@ -9,10 +9,10 @@ import ( "strconv" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/nothing.go b/pkg/transformers/nothing.go similarity index 96% rename from internal/pkg/transformers/nothing.go rename to pkg/transformers/nothing.go index 3652ad83bc..9c5b72f1a0 100644 --- a/internal/pkg/transformers/nothing.go +++ b/pkg/transformers/nothing.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/put_or_filter.go b/pkg/transformers/put_or_filter.go similarity index 97% rename from internal/pkg/transformers/put_or_filter.go rename to pkg/transformers/put_or_filter.go index 6a3b35341b..1437c8b158 100644 --- a/internal/pkg/transformers/put_or_filter.go +++ b/pkg/transformers/put_or_filter.go @@ -6,13 +6,13 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/dsl" - "github.com/johnkerl/miller/internal/pkg/dsl/cst" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/runtime" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/dsl" + "github.com/johnkerl/miller/pkg/dsl/cst" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/runtime" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/regularize.go b/pkg/transformers/regularize.go similarity index 94% rename from internal/pkg/transformers/regularize.go rename to pkg/transformers/regularize.go index 9b6f988822..c75d261f0f 100644 --- a/internal/pkg/transformers/regularize.go +++ b/pkg/transformers/regularize.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/remove_empty_columns.go b/pkg/transformers/remove_empty_columns.go similarity index 96% rename from internal/pkg/transformers/remove_empty_columns.go rename to pkg/transformers/remove_empty_columns.go index 1baf22a8e5..ce9b5a5dcd 100644 --- a/internal/pkg/transformers/remove_empty_columns.go +++ b/pkg/transformers/remove_empty_columns.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/rename.go b/pkg/transformers/rename.go similarity index 98% rename from internal/pkg/transformers/rename.go rename to pkg/transformers/rename.go index 1878b86d1e..e5f0658b8a 100644 --- a/internal/pkg/transformers/rename.go +++ b/pkg/transformers/rename.go @@ -7,9 +7,9 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/reorder.go b/pkg/transformers/reorder.go similarity index 97% rename from internal/pkg/transformers/reorder.go rename to pkg/transformers/reorder.go index 26e1b226bb..216dd714da 100644 --- a/internal/pkg/transformers/reorder.go +++ b/pkg/transformers/reorder.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/repeat.go b/pkg/transformers/repeat.go similarity index 98% rename from internal/pkg/transformers/repeat.go rename to pkg/transformers/repeat.go index a4021d4da9..eab1725f4e 100644 --- a/internal/pkg/transformers/repeat.go +++ b/pkg/transformers/repeat.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) type tRepeatCountSource int diff --git a/internal/pkg/transformers/reshape.go b/pkg/transformers/reshape.go similarity index 98% rename from internal/pkg/transformers/reshape.go rename to pkg/transformers/reshape.go index f82c16dab6..4c0cffc076 100644 --- a/internal/pkg/transformers/reshape.go +++ b/pkg/transformers/reshape.go @@ -34,10 +34,10 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/sample.go b/pkg/transformers/sample.go similarity index 97% rename from internal/pkg/transformers/sample.go rename to pkg/transformers/sample.go index 62482c4b8e..b1eef576b2 100644 --- a/internal/pkg/transformers/sample.go +++ b/pkg/transformers/sample.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/sec2gmt.go b/pkg/transformers/sec2gmt.go similarity index 95% rename from internal/pkg/transformers/sec2gmt.go rename to pkg/transformers/sec2gmt.go index 4aa34bbd8f..0dfbbe5df7 100644 --- a/internal/pkg/transformers/sec2gmt.go +++ b/pkg/transformers/sec2gmt.go @@ -5,10 +5,10 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/sec2gmtdate.go b/pkg/transformers/sec2gmtdate.go similarity index 94% rename from internal/pkg/transformers/sec2gmtdate.go rename to pkg/transformers/sec2gmtdate.go index dc1aca7e0e..d09defffa1 100644 --- a/internal/pkg/transformers/sec2gmtdate.go +++ b/pkg/transformers/sec2gmtdate.go @@ -5,10 +5,10 @@ import ( "fmt" "os" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/seqgen.go b/pkg/transformers/seqgen.go similarity index 96% rename from internal/pkg/transformers/seqgen.go rename to pkg/transformers/seqgen.go index 409596aa27..2d1c3b1889 100644 --- a/internal/pkg/transformers/seqgen.go +++ b/pkg/transformers/seqgen.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/shuffle.go b/pkg/transformers/shuffle.go similarity index 96% rename from internal/pkg/transformers/shuffle.go rename to pkg/transformers/shuffle.go index 8a7cfc46ac..7aad23641b 100644 --- a/internal/pkg/transformers/shuffle.go +++ b/pkg/transformers/shuffle.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/skip_trivial_records.go b/pkg/transformers/skip_trivial_records.go similarity index 96% rename from internal/pkg/transformers/skip_trivial_records.go rename to pkg/transformers/skip_trivial_records.go index 85c5bac21a..91c8bd2421 100644 --- a/internal/pkg/transformers/skip_trivial_records.go +++ b/pkg/transformers/skip_trivial_records.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/sort.go b/pkg/transformers/sort.go similarity index 98% rename from internal/pkg/transformers/sort.go rename to pkg/transformers/sort.go index 429314ddd0..d28009ae46 100644 --- a/internal/pkg/transformers/sort.go +++ b/pkg/transformers/sort.go @@ -48,10 +48,10 @@ import ( "sort" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/sort_within_records.go b/pkg/transformers/sort_within_records.go similarity index 97% rename from internal/pkg/transformers/sort_within_records.go rename to pkg/transformers/sort_within_records.go index d2af984ca8..398ca53722 100644 --- a/internal/pkg/transformers/sort_within_records.go +++ b/pkg/transformers/sort_within_records.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/split.go b/pkg/transformers/split.go similarity index 98% rename from internal/pkg/transformers/split.go rename to pkg/transformers/split.go index 50d415918c..7834931e92 100644 --- a/internal/pkg/transformers/split.go +++ b/pkg/transformers/split.go @@ -7,10 +7,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/ssub.go b/pkg/transformers/ssub.go similarity index 94% rename from internal/pkg/transformers/ssub.go rename to pkg/transformers/ssub.go index bd8e542473..a318647116 100644 --- a/internal/pkg/transformers/ssub.go +++ b/pkg/transformers/ssub.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/stats1.go b/pkg/transformers/stats1.go similarity index 98% rename from internal/pkg/transformers/stats1.go rename to pkg/transformers/stats1.go index ade6939891..b581296911 100644 --- a/internal/pkg/transformers/stats1.go +++ b/pkg/transformers/stats1.go @@ -8,11 +8,11 @@ import ( "regexp" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/stats2.go b/pkg/transformers/stats2.go similarity index 98% rename from internal/pkg/transformers/stats2.go rename to pkg/transformers/stats2.go index c8f1639117..a30141021a 100644 --- a/internal/pkg/transformers/stats2.go +++ b/pkg/transformers/stats2.go @@ -6,11 +6,11 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/step.go b/pkg/transformers/step.go similarity index 99% rename from internal/pkg/transformers/step.go rename to pkg/transformers/step.go index b40aaeed64..56539cb90a 100644 --- a/internal/pkg/transformers/step.go +++ b/pkg/transformers/step.go @@ -73,12 +73,12 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // For EWMA diff --git a/internal/pkg/transformers/sub.go b/pkg/transformers/sub.go similarity index 94% rename from internal/pkg/transformers/sub.go rename to pkg/transformers/sub.go index eee7783624..1c96b45fc6 100644 --- a/internal/pkg/transformers/sub.go +++ b/pkg/transformers/sub.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/summary.go b/pkg/transformers/summary.go similarity index 98% rename from internal/pkg/transformers/summary.go rename to pkg/transformers/summary.go index 6b6134c8bd..1b1db3df4a 100644 --- a/internal/pkg/transformers/summary.go +++ b/pkg/transformers/summary.go @@ -6,11 +6,11 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/tac.go b/pkg/transformers/tac.go similarity index 96% rename from internal/pkg/transformers/tac.go rename to pkg/transformers/tac.go index 5075a3efbf..83ccd68769 100644 --- a/internal/pkg/transformers/tac.go +++ b/pkg/transformers/tac.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/tail.go b/pkg/transformers/tail.go similarity index 96% rename from internal/pkg/transformers/tail.go rename to pkg/transformers/tail.go index 0081ae51d4..dcba44b674 100644 --- a/internal/pkg/transformers/tail.go +++ b/pkg/transformers/tail.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/tee.go b/pkg/transformers/tee.go similarity index 97% rename from internal/pkg/transformers/tee.go rename to pkg/transformers/tee.go index 04bd656485..9e944df17b 100644 --- a/internal/pkg/transformers/tee.go +++ b/pkg/transformers/tee.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/output" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/output" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/template.go b/pkg/transformers/template.go similarity index 95% rename from internal/pkg/transformers/template.go rename to pkg/transformers/template.go index 152f0878e5..392f96377c 100644 --- a/internal/pkg/transformers/template.go +++ b/pkg/transformers/template.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/top.go b/pkg/transformers/top.go similarity index 97% rename from internal/pkg/transformers/top.go rename to pkg/transformers/top.go index 3cdb1dc574..70119731b2 100644 --- a/internal/pkg/transformers/top.go +++ b/pkg/transformers/top.go @@ -6,11 +6,11 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/transformers/utils" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/transformers/utils" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/unflatten.go b/pkg/transformers/unflatten.go similarity index 97% rename from internal/pkg/transformers/unflatten.go rename to pkg/transformers/unflatten.go index af0a3a9044..d1e02a52ca 100644 --- a/internal/pkg/transformers/unflatten.go +++ b/pkg/transformers/unflatten.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/uniq.go b/pkg/transformers/uniq.go similarity index 98% rename from internal/pkg/transformers/uniq.go rename to pkg/transformers/uniq.go index a3dd68ef4f..f28e6c854e 100644 --- a/internal/pkg/transformers/uniq.go +++ b/pkg/transformers/uniq.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/unspace.go b/pkg/transformers/unspace.go similarity index 97% rename from internal/pkg/transformers/unspace.go rename to pkg/transformers/unspace.go index 20e2b33654..eb62530255 100644 --- a/internal/pkg/transformers/unspace.go +++ b/pkg/transformers/unspace.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/unsparsify.go b/pkg/transformers/unsparsify.go similarity index 96% rename from internal/pkg/transformers/unsparsify.go rename to pkg/transformers/unsparsify.go index 72e6c8626f..467b83dac6 100644 --- a/internal/pkg/transformers/unsparsify.go +++ b/pkg/transformers/unsparsify.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utf8_to_latin1.go b/pkg/transformers/utf8_to_latin1.go similarity index 93% rename from internal/pkg/transformers/utf8_to_latin1.go rename to pkg/transformers/utf8_to_latin1.go index e3f09210dc..fb658562a9 100644 --- a/internal/pkg/transformers/utf8_to_latin1.go +++ b/pkg/transformers/utf8_to_latin1.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utils/README.md b/pkg/transformers/utils/README.md similarity index 100% rename from internal/pkg/transformers/utils/README.md rename to pkg/transformers/utils/README.md diff --git a/internal/pkg/transformers/utils/doc.go b/pkg/transformers/utils/doc.go similarity index 100% rename from internal/pkg/transformers/utils/doc.go rename to pkg/transformers/utils/doc.go diff --git a/internal/pkg/transformers/utils/join_bucket.go b/pkg/transformers/utils/join_bucket.go similarity index 92% rename from internal/pkg/transformers/utils/join_bucket.go rename to pkg/transformers/utils/join_bucket.go index 92b169541f..4e26e25380 100644 --- a/internal/pkg/transformers/utils/join_bucket.go +++ b/pkg/transformers/utils/join_bucket.go @@ -7,7 +7,7 @@ package utils import ( "container/list" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utils/join_bucket_keeper.go b/pkg/transformers/utils/join_bucket_keeper.go similarity index 98% rename from internal/pkg/transformers/utils/join_bucket_keeper.go rename to pkg/transformers/utils/join_bucket_keeper.go index 6f0e307b9c..df218cc3d5 100644 --- a/internal/pkg/transformers/utils/join_bucket_keeper.go +++ b/pkg/transformers/utils/join_bucket_keeper.go @@ -113,11 +113,11 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/cli" - "github.com/johnkerl/miller/internal/pkg/input" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/cli" + "github.com/johnkerl/miller/pkg/input" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utils/percentile_keeper.go b/pkg/transformers/utils/percentile_keeper.go similarity index 97% rename from internal/pkg/transformers/utils/percentile_keeper.go rename to pkg/transformers/utils/percentile_keeper.go index b89f8831b4..0aebdc7099 100644 --- a/internal/pkg/transformers/utils/percentile_keeper.go +++ b/pkg/transformers/utils/percentile_keeper.go @@ -8,8 +8,8 @@ import ( "fmt" "sort" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/mlrval" ) type PercentileKeeper struct { diff --git a/internal/pkg/transformers/utils/stats1_accumulators.go b/pkg/transformers/utils/stats1_accumulators.go similarity index 99% rename from internal/pkg/transformers/utils/stats1_accumulators.go rename to pkg/transformers/utils/stats1_accumulators.go index c984ed9229..02756a9a34 100644 --- a/internal/pkg/transformers/utils/stats1_accumulators.go +++ b/pkg/transformers/utils/stats1_accumulators.go @@ -9,9 +9,9 @@ import ( "os" "strings" - "github.com/johnkerl/miller/internal/pkg/bifs" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/bifs" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utils/stats2_accumulators.go b/pkg/transformers/utils/stats2_accumulators.go similarity index 99% rename from internal/pkg/transformers/utils/stats2_accumulators.go rename to pkg/transformers/utils/stats2_accumulators.go index 05274b21f8..84fcdc030b 100644 --- a/internal/pkg/transformers/utils/stats2_accumulators.go +++ b/pkg/transformers/utils/stats2_accumulators.go @@ -9,8 +9,8 @@ import ( "math" "os" - "github.com/johnkerl/miller/internal/pkg/lib" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/lib" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utils/top_keeper.go b/pkg/transformers/utils/top_keeper.go similarity index 96% rename from internal/pkg/transformers/utils/top_keeper.go rename to pkg/transformers/utils/top_keeper.go index 1a536e5cd3..3a3ce9e4ec 100644 --- a/internal/pkg/transformers/utils/top_keeper.go +++ b/pkg/transformers/utils/top_keeper.go @@ -5,8 +5,8 @@ package utils import ( - "github.com/johnkerl/miller/internal/pkg/mlrval" - "github.com/johnkerl/miller/internal/pkg/types" + "github.com/johnkerl/miller/pkg/mlrval" + "github.com/johnkerl/miller/pkg/types" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/transformers/utils/window_keeper.go b/pkg/transformers/utils/window_keeper.go similarity index 97% rename from internal/pkg/transformers/utils/window_keeper.go rename to pkg/transformers/utils/window_keeper.go index 7c213ad71d..2de8750207 100644 --- a/internal/pkg/transformers/utils/window_keeper.go +++ b/pkg/transformers/utils/window_keeper.go @@ -1,7 +1,7 @@ package utils import ( - "github.com/johnkerl/miller/internal/pkg/lib" + "github.com/johnkerl/miller/pkg/lib" ) // WindowKeeper is a sliding-window container, nominally for use by mlr step, diff --git a/internal/pkg/transformers/utils/window_keeper_test.go b/pkg/transformers/utils/window_keeper_test.go similarity index 100% rename from internal/pkg/transformers/utils/window_keeper_test.go rename to pkg/transformers/utils/window_keeper_test.go diff --git a/internal/pkg/types/README.md b/pkg/types/README.md similarity index 100% rename from internal/pkg/types/README.md rename to pkg/types/README.md diff --git a/internal/pkg/types/context.go b/pkg/types/context.go similarity index 98% rename from internal/pkg/types/context.go rename to pkg/types/context.go index a0771efa33..08ba3cbb60 100644 --- a/internal/pkg/types/context.go +++ b/pkg/types/context.go @@ -5,7 +5,7 @@ import ( "container/list" "strconv" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) // Since Go is concurrent, the context struct (AWK-like variables such as diff --git a/internal/pkg/types/doc.go b/pkg/types/doc.go similarity index 100% rename from internal/pkg/types/doc.go rename to pkg/types/doc.go diff --git a/internal/pkg/types/indexed-lvalues.md b/pkg/types/indexed-lvalues.md similarity index 100% rename from internal/pkg/types/indexed-lvalues.md rename to pkg/types/indexed-lvalues.md diff --git a/internal/pkg/types/mlrval_typing.go b/pkg/types/mlrval_typing.go similarity index 97% rename from internal/pkg/types/mlrval_typing.go rename to pkg/types/mlrval_typing.go index 85ad30d48c..e3c68b5f87 100644 --- a/internal/pkg/types/mlrval_typing.go +++ b/pkg/types/mlrval_typing.go @@ -8,7 +8,7 @@ package types import ( "fmt" - "github.com/johnkerl/miller/internal/pkg/mlrval" + "github.com/johnkerl/miller/pkg/mlrval" ) // ---------------------------------------------------------------- diff --git a/internal/pkg/version/doc.go b/pkg/version/doc.go similarity index 100% rename from internal/pkg/version/doc.go rename to pkg/version/doc.go diff --git a/internal/pkg/version/version.go b/pkg/version/version.go similarity index 100% rename from internal/pkg/version/version.go rename to pkg/version/version.go diff --git a/regression_test.go b/regression_test.go index 1e819f2f8d..5657d17bc9 100644 --- a/regression_test.go +++ b/regression_test.go @@ -5,13 +5,13 @@ import ( "os" "testing" - "github.com/johnkerl/miller/internal/pkg/terminals/regtest" + "github.com/johnkerl/miller/pkg/terminals/regtest" ) // TestRegression is a familiar entry point for regression testing. Miller // regression tests are more flexibly invoked via 'mlr regtest'. However here // is a standard location so people can get at them via 'go test'. Please see -// (as of this writing) internal/pkg/terminals/regtest for the Miller regtest package. +// (as of this writing) pkg/terminals/regtest for the Miller regtest package. func TestRegression(t *testing.T) { // How much detail to show? There are thousands of cases, organized into a // few hundred top-level directories under ./test/cases. diff --git a/scripts/mcountlines b/scripts/mcountlines index 3c16c481f4..7a9cfd90f3 100755 --- a/scripts/mcountlines +++ b/scripts/mcountlines @@ -1,14 +1,14 @@ #!/bin/bash wc -l \ - $(find internal -name \*.go | grep -v internal/pkg/parsing) \ - internal/pkg/parsing/mlr.bnf \ + $(find -name \*.go | grep -v pkg/parsing) \ + pkg/parsing/mlr.bnf \ | sort -n echo wc -c \ - $(find internal -name \*.go | grep -v internal/pkg/parsing) \ - internal/pkg/parsing/mlr.bnf \ + $(find -name \*.go | grep -v pkg/parsing) \ + pkg/parsing/mlr.bnf \ | sort -n \ | tail -n 5 diff --git a/todo.txt b/todo.txt index eea98acf37..5507dd73e1 100644 --- a/todo.txt +++ b/todo.txt @@ -280,7 +280,7 @@ DOC w contact re https://jsonlines.org/on_the_web/ * verslink old relnotes * single UT, hard to invoke w/ new full go.mod path - go test $(ls internal/pkg/lib/*.go|grep -v test) internal/pkg/lib/unbackslash_test.go + go test $(ls pkg/lib/*.go|grep -v test) pkg/lib/unbackslash_test.go etc * file-formats: NIDX link to headerless CSV * window.mlr, window2.mlr -> doc somewhere diff --git a/tools/build-dsl b/tools/build-dsl index 90854230f3..e2a6186d2b 100755 --- a/tools/build-dsl +++ b/tools/build-dsl @@ -35,26 +35,26 @@ if [ ! -x "$bingocc" ]; then exit 1 fi -rm -f internal/pkg/parsing/*.txt +rm -f pkg/parsing/*.txt if [ "$verbose" = "true" ]; then - lr1="internal/pkg/parsing/LR1_conflicts.txt" - $bingocc -v -o ./internal/pkg/parsing -p mlr/internal/pkg/parsing internal/pkg/parsing/mlr.bnf || expand -2 $lr1 + lr1="pkg/parsing/LR1_conflicts.txt" + $bingocc -v -o ./pkg/parsing -p mlr/pkg/parsing pkg/parsing/mlr.bnf || expand -2 $lr1 else - $bingocc -o ./internal/pkg/parsing -p mlr/internal/pkg/parsing internal/pkg/parsing/mlr.bnf + $bingocc -o ./pkg/parsing -p mlr/pkg/parsing pkg/parsing/mlr.bnf fi # Code-gen directories: -# internal/pkg/parsing/errors/ -# internal/pkg/parsing/lexer/ -# internal/pkg/parsing/parser/ -# internal/pkg/parsing/token/ -# internal/pkg/parsing/util/ +# pkg/parsing/errors/ +# pkg/parsing/lexer/ +# pkg/parsing/parser/ +# pkg/parsing/token/ +# pkg/parsing/util/ # Override GOCC codegen with customized error handling -cp internal/pkg/parsing/errors.go.template internal/pkg/parsing/errors/errors.go +cp pkg/parsing/errors.go.template pkg/parsing/errors/errors.go # We might need a manual replace of os.ReadFile by ioutil.ReadFile in autogen code. Note we don't # use latest-and-greatest Go compiler version in our go.mod since we want to build on Centos which # can be trailing-edge in that regard. -for x in internal/pkg/parsing/*/*.go; do gofmt -w $x; done +for x in pkg/parsing/*/*.go; do gofmt -w $x; done