FAQ
Hi all,

Background:
I'm a newbie with 0.5 days of Go experience. Google search told me that
bufio.Scanner was nice for looping over text lines, so I had a look at this
page http://golang.org/pkg/bufio/#NewScanner

func NewScanner(r io <http://golang.org/pkg/io/>.Reader <http://golang.org/pkg/io/#Reader>) *Scanner <http://golang.org/pkg/bufio/#Scanner>
The signature tells me I should pass an instance of the io.Reader
interface. However, since Go adapts structural (rather than nominal)
typing for its interfaces, I was at first perplexed about finding concrete
types satisfying the interface. (Now I know os.File is one of them.)

On the other hand, Javadoc has "All known implementing classes" section for
a given interface, which I often find useful. See, eg.
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/Channel.html

All Known Implementing Classes: AbstractInterruptibleChannel<http://docs.oracle.com/javase/7/docs/api/java/nio/channels/spi/AbstractInterruptibleChannel.html>,

Question:
Are there anything like this in the Go world, at least for the standard
libraries?

Best regards,
Kai

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 19, '13 at 12:35p
activeDec 19, '13 at 8:17p
posts8
users6
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase