Use latest ReadAll helper function
This commit is contained in:
parent
616f27e363
commit
7b07dc29bc
@ -15,6 +15,7 @@ var popularity = map[string]*arn.AnimePopularity{}
|
||||
// made to it.
|
||||
func main() {
|
||||
color.Yellow("Updating anime ratings")
|
||||
color.Cyan(arn.Node.Address().String())
|
||||
|
||||
defer color.Green("Finished.")
|
||||
defer arn.Node.Close()
|
||||
|
@ -36,15 +36,5 @@ func Subtitles(ctx *aero.Context) string {
|
||||
}
|
||||
|
||||
defer obj.Close()
|
||||
|
||||
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)
|
||||
return ctx.ReadAll(obj)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user