go-linereader

Golang package that reads lines from an io.Reader and puts them onto a channel.

  • 所有者: mitchellh/go-linereader
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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:

// 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.
}

主要指標

概覽
名稱與所有者mitchellh/go-linereader
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-10-05 17:11:03
推送於2019-02-13 21:33:13
最后一次提交2019-02-13 13:33:12
發布數0
用户参与
星數67
關注者數3
派生數5
提交數5
已啟用問題?
問題數2
打開的問題數0
拉請求數1
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?