mattolenik / hclq

Command-line processor for HashiCorp config files, like sed for HCL — Terraform, Consul, Nomad, Vault
https://hclq.sh
The Unlicense
254 stars 23 forks source link

Can you move the readAll call on cmd and use bytes on queryHCL #2

Closed sebglon closed 5 years ago

sebglon commented 6 years ago

To easily reuse go code as lib, can you move the reader param on method func HCL(reader io.Reader, qry *Query) (results []Result, isList bool, node *ast.File, err error) by bytes.

THis is more easy to reuse your lib on another Go project.

readAll is a stream and can be call only once. after the reader content is empty.

mattolenik commented 5 years ago

Sorry for the late response! The recent changes in the 0.5.x releases should make using hclq as a library much easier. The API isn't necessarily final but it is easy enough to work with at the moment. Feedback on it much appreciated!