Use latest ReadAll helper function

This commit is contained in:
Eduard Urbach 2018-12-12 12:40:28 +09:00
parent 616f27e363
commit 7b07dc29bc
2 changed files with 2 additions and 11 deletions

View File

@ -15,6 +15,7 @@ var popularity = map[string]*arn.AnimePopularity{}
// made to it. // made to it.
func main() { func main() {
color.Yellow("Updating anime ratings") color.Yellow("Updating anime ratings")
color.Cyan(arn.Node.Address().String())
defer color.Green("Finished.") defer color.Green("Finished.")
defer arn.Node.Close() defer arn.Node.Close()

View File

@ -36,15 +36,5 @@ func Subtitles(ctx *aero.Context) string {
} }
defer obj.Close() defer obj.Close()
return ctx.ReadAll(obj)
data := make([]byte, 0, 65535)
buffer := make([]byte, 4096)
n := 0
for err == nil {
n, err = obj.Read(buffer)
data = append(data, buffer[:n]...)
}
return string(data)
} }