// counts - byte, character, newline & word counts
byte, character, newline & word counts
// counts - byte character newline & word counts
func (d *data) counts() error {
	file, err := ioutil.ReadFile(d.fa)
	if err != nil {
		return err
	}
	d.bc = len(file)
	d.nc = strings.Count(string(file), "\n")
	d.cc = len([]rune(string(file)))
	d.wc = len(strings.Fields(string(file)))
	return nil
}
func ( d * data ) counts ( ) error { file , err := ioutil . ReadFile ( d . fa ) if err != nil { return err } d . bc = len ( file ) d . nc = strings . Count ( string ( file ) , " \n " ) d . cc = len ( [ ] rune ( string ( file ) ) ) d . wc = len ( strings . Fields ( string ( file ) ) ) return nil }
byte, character, newline & word counts
byte character newline & word counts