fread

package
v0.0.0-...-e8ebaed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2017 License: MIT Imports: 3 Imported by: 5

README

fread

Package to read from an io.Reader similar to C's fread(*FILE,...)

and it returns a channel of strings chan string

Usage in programs

import "github.com/odeke-em/go-utils/fread"

...

f := os.Stdin  // Could be something else
linesChan := fread.Fread(f)
linesChanWithIgnorer := fread.Fread(f, func(s string) bool { return len(s) >= 1 && s[0] == "#"} )

Sample program

$ go get github.com/odeke-em/go-utils/cmd/stdin-io

That will just read content from stdin and dump it to stdout.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fread

func Fread(f io.Reader) (linesChan chan string)

func FreadWithIgnorer

func FreadWithIgnorer(f io.Reader, ignorer func(string) bool) chan string

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL