How to parse out blobs from the buffer


(Andrew Montoya) #1

Hello All! I’m new to using Golang. The docs for blobs have examples of reading/writing blobs to and from a file, but how could I directly read a blob that’s captured in the buffer?

    import (
    "gocloud.dev/blob"
    )
i := 0
scanner := bufio.NewScanner(conn)
for scanner.Scan() {
    // newData := scanner.Bytes()
	// bucket, er := blob.Reader(newData)
	// bucket, err := blob.OpenBucket(context.Background(), newData)
	ln := scanner.Text()    // Returns 3B blob data
	fmt.Println(ln)
}