Do remember that just because it satisfies an interface doesn't mean it...
satisfies an interface. Interfaces are more than method signatures, they're
about expected behavior. It's perfectly possible to satisfy some random
package's Deleter { func Delete() } interface and yet if you were to
actually let that package call said delete method, Bad Nonsense™ would
happen. I could see my Graph implementations in Gonum technically implement
some other package's Graph interface and yet not actually follow them the
way they're intended to be followed.
On Thursday, December 19, 2013 8:13:54 AM UTC-7, Kai Noda wrote:

Hi Martin and Chris,

Thank you so much for your valuable information. I'll give them a try
(after installation of Go1.2 --- oracle and implements didn't compile with
Go1.0 SDK from Ubuntu 12.04). sourcegraph.com seems to be very useful
for other purposes, too.


2013年12月19日木曜日 22時36分07秒 UTC+8 Chris Hines:

On Thursday, December 19, 2013 7:35:31 AM UTC-5, Kai Noda wrote:

Hi all,

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.

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

Are there anything like this in the Go world, at least for the standard

Best regards,
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

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 8 | next ›
Discussion Overview
groupgolang-nuts @
postedDec 19, '13 at 12:35p
activeDec 19, '13 at 8:17p



site design / logo © 2022 Grokbase