internal/source: simplify ReadAll
It's unclear to me why we were rolling our own version of io.ReadAll;
the standard library function already does what we need here.
While here, remove the nil check on *bytes.Buffer.
If a user sets cue/build.File.Source to (*bytes.Buffer)(nil),
that seems like a bug that should result in a panic
rather than silently reading zero bytes.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I636d3f43c7085a8b94ffd7541504324ee83250dd
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1225201
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>