diff --git a/Makefile b/Makefile index 60c7ce578..fb374cb91 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 6c3b5ca8c..0e363db5c 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 c1a1977b4..0b9cd76e3 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 305fa6062..5f5093eee 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 23ed5b5b6..3e37bdca1 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 c185b8752..f93e0226e 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 82a4905b0..5ae6209cc 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 5ea29ed16..287d929c7 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 e2a6c59f9..0b6787898 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 b01464d20..5138c9b8f 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 4c7e97628..d8675cdbc 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 ad26704cf..2754a2bfd 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 0d22cfdab..0037efeb2 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 ccf519ced..3087f568f 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 000000000..49c381138 --- /dev/null +++ b/docs/src/miller-as-library.md @@ -0,0 +1,202 @@ + +
+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 000000000..b7051165b --- /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 000000000..c56f5a0db --- /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 000000000..07d4be50e --- /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 eb6f48300..000000000 --- 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 ccf519ced..3087f568f 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 b8794a352..a98daa906 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 7728270ec..f5a2b853e 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 2890c37e7..76efd45ea 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 c0bf0e810..28aa0d6bf 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 7fb786307..5ed8cc20e 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 bc88698a1..96718e00d 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 da77c6199..c0b3bc3db 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 7d31cb7ee..832feab57 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 5278b5b6a..a734ee451 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 417ae3534..16ffba8c6 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 4126078b1..9fa11e6b0 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 09552ab0f..e2d09d1e4 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 3e736c0a0..6b44028be 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 b18e0d4ed..b415cb809 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 087e7f200..cecb98aec 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 5562b4d30..c85509da6 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 72a6878b4..52cab9ac5 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 d6d57b16a..f36258ffe 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 c809f7167..ff3531a31 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 3fc21c84a..735ceab83 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 7ef8019a4..cd68ee480 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 a3ac73ad4..d56f0bb66 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 b57e0dc84..87ee80448 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 000000000..f08cc1aba --- /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 bcb86e290..590487d43 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 013deb582..7f838a096 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 b70d4a2f7..d959e0c52 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 9dda91ebd..421af9af8 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 a1b380667..1cd6b186d 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 beb4aa45c..d3c5c1401 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 e68b5902e..9e8679eef 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 e465ed2b7..b05643bce 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 8ac92b0fe..b507e1936 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 53ff79eb3..923f413db 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 47f3a583d..f417998f6 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 825b338e9..6856ce830 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 02dc6f73a..d1936faf9 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 41540ed20..129ec850c 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 3a912a990..b52b363cb 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 6eb805b11..d51c70d75 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 e9154dc60..7fbf60f3d 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 dfc1b4596..26f1dacce 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 66d63788f..1dcee4daf 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 cd5f0c128..f7f0063e3 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 a53e43a1b..14070527d 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 5a43105c7..a4996e312 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 43e87243f..3552f023d 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 213149e86..97aebfe98 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 73e37c343..c2f038f2d 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 d46cab5b1..9440537ba 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 dfab5ceee..4a4d3984e 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 3e9b7e309..34d6b808d 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 d601a0644..5aca6d397 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 9257d7f46..87edc01b2 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 40da46c7a..b947c7f6e 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 23340ccf8..c5bec8f7a 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 41b9cef3a..382525e52 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 6be69e88b..073c5d991 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 a7318c398..8c68593be 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 979c82ad1..f48ebc330 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 aeac8e80a..1ee554763 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 1ea5ca026..ce42cb854 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 b91326a81..6c1b76dae 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 b76ac4320..df9b8ff0b 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 e9a606afd..4fa935edf 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 83c1a5b09..9be4bf59c 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 944db7a11..3a72e4c23 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 e5e4746ef..305c1bf7f 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 a66874ee9..55850c8b1 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 538c1f153..4e088df6c 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 1cf624d4e..ff79d26e0 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 f48a8f10b..7f7fab711 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 2808ce451..6479cb4d7 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 b56a25ceb..280201936 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 93ce89857..9d2352983 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 fc1da8dc7..b2c2f1853 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 630f78657..222064358 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 d7f83dd76..5cd92f77d 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 101cfc83d..77e0e557f 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 2a501831b..e8328fd51 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 7cdd02fb9..27b9b8e2c 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 7b496e725..d3b9d75a3 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 1cb8ff79e..0cfc74b25 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 151120040..a348ff900 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 ab8eb7f11..276b2893b 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 920db7955..53ce49cc2 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 9ad8e5999..befb5f726 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 bb91901b7..8e48ba515 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 726c38fb7..d185efc99 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 a33a2f441..f788cc35b 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 cb8a1f6ee..8d7c576b2 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 c9968d65a..cebd3af25 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 1e33b552b..5f4e305a6 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 c88d8d36a..2eb6bfb66 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 cf28bd260..ada3792bd 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 d1593776e..5b3fcd9e8 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 0b60d0ee5..c657815ec 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 474dcb807..eafea9afd 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 ea7ed814d..6805ad890 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 c7cf6f483..d21cfb812 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 30b17badb..37d8a7780 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 076c6778c..fd4801d29 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 43434e643..9cb103b6a 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 6acf0976c..251cf9580 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 674388130..bc60868ca 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 a48c68f99..b706f21bd 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 3ee176852..578e9f8ba 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 c7bdf280d..2688c2962 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 a0e350958..d3babd35a 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 f714e86fa..79d49b316 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 3a7b53953..149ac9530 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 a13536c1e..9093935e9 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 58ae6926e..161e5c75d 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 da89c0bac..5c39ede1d 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 b3a2ff9c7..2d1f13f3f 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 da89c0bac..5c39ede1d 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 080936766..18917879f 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 8381497d4..ed55d4bd2 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 18fd8ea7a..d106a08a3 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 6f987c827..39d6c0c3b 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 e67ea07a5..031a6d91c 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 8402d1bed..444e9f495 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 bd84651b2..f4b61fd50 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 a41d41816..77899ed79 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 af6cd78c2..1a61fda12 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 a5cf2499e..b32cd06dd 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 8c3a6caca..e94fd4ce5 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 0d023a25f..e905bb735 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 351eda06d..9f2cbe805 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 6598c48b3..3b25b58b5 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 a1cf4a921..febbbbfa3 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 34550053b..ec58bdf73 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 87d6500f0..8f3a2a046 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 28f873fd7..d2403ccdf 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 7c0341881..bfcb46d2c 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 98b77aa74..03ef0f6b4 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 ea20658a6..b0da1b9d3 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 a47e93d53..92d9046ff 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 91f0fecf4..78ec0dd3f 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 81e954e50..e367ab883 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 4a8dfaa43..1f9bae7dd 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 ece90a858..ed98af07f 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 af3c4f02b..a97c3127e 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 d7157da54..0aaafd8f1 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 8447fb171..9450a425e 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 f25a68f96..4d02617c4 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 045b57a73..c065aa536 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 0301dad7d..9f3600190 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 c5c9bf51c..3ffdd3862 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 91c73ee0d..623855ac9 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 9707216de..2fafe2d70 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 35c22bbcd..f3039f65a 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 9446c0502..8535c1d4b 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 88b78ef9b..b9ab079dc 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 1b6f93193..e893ef334 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 479df8a9c..a2f4d1a97 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 fc0372e83..d91041c27 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 9327ce208..fb90ab2bf 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 2a8e8536c..345780f4e 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 5f3f217fd..6e8c8f183 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 aa51e3bd0..f210969ad 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 860ae8b80..a7ede9a59 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 550aeda5a..0b188505b 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 1a8442a8b..b17e6cecc 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 3209db5b2..4626ddead 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 39ae3aa62..a7d6241fb 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 51c73cccb..3d8547a12 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 64904a653..1a00ccf08 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 71e3d4d76..ca515f0a0 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 876aeb7b0..b14be1b6d 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 0783b6279..b3dca48b5 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 fe48d5e8d..de1a555c3 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 2e58999eb..1381e81d9 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 c8e98d486..bced869df 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 3652ad83b..9c5b72f1a 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 6a3b35341..1437c8b15 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 9b6f98882..c75d261f0 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 1baf22a8e..ce9b5a5dc 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 1878b86d1..e5f0658b8 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 26e1b226b..216dd714d 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 a4021d4da..eab1725f4 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 f82c16dab..4c0cffc07 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 62482c4b8..b1eef576b 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 4aa34bbd8..0dfbbe5df 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 dc1aca7e0..d09defffa 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 409596aa2..2d1c3b188 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 8a7cfc46a..7aad23641 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 85c5bac21..91c8bd242 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 429314ddd..d28009ae4 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 d2af984ca..398ca5372 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 50d415918..7834931e9 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 bd8e54247..a31864711 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 ade693989..b58129691 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 c8f163911..a30141021 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 b40aaeed6..56539cb90 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 eee778362..1c96b45fc 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 6b6134c8b..1b1db3df4 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 5075a3efb..83ccd6876 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 0081ae51d..dcba44b67 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 04bd65648..9e944df17 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 152f0878e..392f96377 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 3cdb1dc57..70119731b 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 af0a3a904..d1e02a52c 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 a3dd68ef4..f28e6c854 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 20e2b3365..eb6253025 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 72e6c8626..467b83dac 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 e3f09210d..fb658562a 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 92b169541..4e26e2538 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 6f0e307b9..df218cc3d 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 b89f8831b..0aebdc709 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 c984ed922..02756a9a3 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 05274b21f..84fcdc030 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 1a536e5cd..3a3ce9e4e 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 7c213ad71..2de875020 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 a0771efa3..08ba3cbb6 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 85ad30d48..e3c68b5f8 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 1e819f2f8..5657d17bc 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 3c16c481f..7a9cfd90f 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 eea98acf3..5507dd73e 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 90854230f..e2a6186d2 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