Wolfgang
unread,Aug 6, 2010, 2:18:01 PM8/6/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hi--
i have the following bit of test code:
package fastq
import (
"testing"
"os"
"fmt"
)
var testfileName string = "test.fq"
func TestEchoFastq(t *testing.T) {
tagsFile, err := os.Open(testfileName, os.O_RDONLY, 0)
tags := ParseFastq(tagsFile)
if err == nil {
t.Fatal("Could not open testfile %s", testfileName)
}
for t := range tags {
fmt.Fprint(os.Stderr, t)
}
}
where ParseFastq is defined as 'func ParseFastq(input *io.Reader)
chan<- *tag.Tag'.
The compiler complains:
cannot use tagsFile (type *os.File) as type *io.Reader in function
argument
From the documentation, it seems that the os.File should fulfill the
io.Reader interface. What am i doing wrong here?
I'm new to go, so please excuse me if this is something obvious that i
missed.
Thanks,
Wolfgang