file/find.go
func Contain(filename string, b []byte) (bool, error) {
	f, err := os.Open(filename)
	if err != nil {
		return false, fmt.Errorf("Contain: %s", err)
	}
	defer f.Close()

	buf := bufio.NewReader(f)

	for {
		line, err := buf.ReadBytes('\n')
		if err == io.EOF {
			break
		}
		if bytes.Contains(line, b) {
			return true, nil
		}
	}
	return false, nil
}
func Contain(filename string, b []byte) (bool, error) {
	f, err := os.Open(filename)
	if err != nil {
		return false, fmt.Errorf("Contain: %s", err)
	}
	defer f.Close()

	buf := bufio.NewReader(f)

	for {
		line, err := buf.ReadBytes('\n')
		if err == io.EOF {
			break
		}
		if bytes.Contains(line, b) {
			return true, nil
		}
	}
	return false, nil
}
func Contain ( filename string , b [ ] byte ) ( bool , error ) { f , err := os . Open ( filename ) if err != nil { return false , fmt . Errorf ( " " , err ) } defer f . Close ( ) buf := bufio . NewReader ( f ) for { line , err := buf . ReadBytes ( '\n' ) if err == io . EOF { break } if bytes . Contains ( line , b ) { return true , nil } } return false , nil }
// Contain returns whether the named file contains the byte slice b. The
// return value is a boolean.
Contain returns whether the named file contains the byte slice b . The return value is a boolean .