Last active
August 29, 2015 14:02
-
-
Save aybabtme/1da359fa2212f858ccec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch { | |
case olderr != nil && newerr != nil: | |
return diff, fmt.Errorf("reading both source, %v", olderr) | |
case olderr != nil: | |
return diff, fmt.Errorf("reading old source, %v", olderr) | |
case newerr != nil: | |
return diff, fmt.Errorf("reading new source, %v", newerr) | |
default: | |
return diff, nil | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { | |
line, err := rd.ReadBytes('\n') | |
switch err { | |
case io.EOF: | |
return nil | |
case nil: | |
default: | |
return err | |
} | |
total += uint64(len(line) + 1) | |
lines <- line | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment