Check first for runtime defined array (typ.cat of valueT) to avoid checking inexisting properties (an panic), when deciding to use appendSlice or not. Fixes #880.
16 lines
216 B
Go
16 lines
216 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"bytes"
|
|
)
|
|
|
|
func main() {
|
|
s := bufio.NewScanner(bytes.NewReader([]byte("Hello\nTest\nLine3")))
|
|
s.Scan()
|
|
println(string(append(s.Bytes(), " World"...)))
|
|
}
|
|
|
|
// Output:
|
|
// Hello World
|