mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-06 06:37:58 -05:00
* Remove `make updatedeps` from Travis build. We'll follow up with more specific plans around dependency updating in subsequent PRs. * Update all `make` targets to set `GO15VENDOREXPERIMENT=1` and to filter out `/vendor/` from `./...` where appropriate. * Temporarily remove `vet` from the `make test` target until we can figure out how to get it to not vet `vendor/`. (Initial experimentation failed to yield the proper incantation.) Everything is pinned to current master, with the exception of: * Azure/azure-sdk-for-go which is pinned before the breaking change today * aws/aws-sdk-go which is pinned to the most recent tag The documentation still needs to be updated, which we can do in a follow up PR. The goal here is to unblock release.
31 lines
870 B
Markdown
31 lines
870 B
Markdown
# go-linereader
|
|
|
|
`go-linereader` (Golang package: `linereader`) is a package for Go that
|
|
breaks up the input from an io.Reader into multiple lines. It is
|
|
a lot like `bufio.Scanner`, except you can specify timeouts that will push
|
|
"lines" through after a certain amount of time. This lets you read lines,
|
|
but return any data if a line isn't updated for some time.
|
|
|
|
## Installation and Usage
|
|
|
|
Install using `go get github.com/mitchellh/go-linereader`.
|
|
|
|
Full documentation is available at
|
|
http://godoc.org/github.com/mitchellh/go-linereader
|
|
|
|
Below is an example of its usage ignoring errors:
|
|
|
|
```go
|
|
// Assume r is some set io.Reader. Perhaps a file, network, anything.
|
|
var r io.Reader
|
|
|
|
// Initialize the line reader
|
|
lr := linereader.New(r)
|
|
|
|
// Get all the lines
|
|
for line := <-lr.Ch {
|
|
// Do something with the line. This line will have the line separator
|
|
// removed.
|
|
}
|
|
```
|