https://github.com/snabb/lazybytes
Go package lazybytes implements a lazily initialized bytes.Reader. (golang)
https://github.com/snabb/lazybytes
Last synced: 6 months ago
JSON representation
Go package lazybytes implements a lazily initialized bytes.Reader. (golang)
- Host: GitHub
- URL: https://github.com/snabb/lazybytes
- Owner: snabb
- License: mit
- Created: 2016-06-26T14:01:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T20:36:08.000Z (over 7 years ago)
- Last Synced: 2025-12-17T14:50:43.890Z (7 months ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
lazybytes
=========
[](https://godoc.org/github.com/snabb/lazybytes)
The Go package lazybytes implements a bytes.Reader which is initialized
lazily on first access.
Documentation:
https://godoc.org/github.com/snabb/lazybytes
Simple example:
```
f := func() []byte {
fmt.Println("initializing")
return []byte("hello world\n")
}
lr := lazybytes.NewReader(f)
fmt.Println("not yet initialized")
fmt.Println("len =", lr.Len())
lr.WriteTo(os.Stdout)
// Output:
// not yet initialized
// initializing
// len = 12
// hello world
```
The Git repository is located at: https://github.com/snabb/lazybytes
License
-------
MIT