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.
|
// 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()
|
||||||
|
@ -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)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user