[go-nuts] Re: Using "er" and "able" for interfaces

2019-01-18 Thread Haddock
Am Mittwoch, 16. Januar 2019 15:42:38 UTC+1 schrieb Victor Giordano: > > Hello all! > I don't know very well what is the topic about using "er" or "able" or any > other suffix for the single method interfaces (a.k.a. "funcitonal > interfaces"), but i would like to address some thoughts, hope

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread Ian Davis
On Thu, 17 Jan 2019, at 7:48 PM, Jakob Borg wrote: > On 16 Jan 2019, at 15:42, Victor Giordano wrote: > >> >> As far i can get to understand the english language (i'm not a native >> speaker), the "er" seems to denotes or describe things in a more "active >> way" (the thing that they

Re: [go-nuts] Accessing the build cache

2019-01-18 Thread Ian Lance Taylor
On Fri, Jan 18, 2019 at 5:34 AM Jan B wrote: > > Is there any way to access go's build cache? Specifically, i want to check if > the source files of my program have changed (i.e. it needs to be recompiled). > I've searched through the go tools but couldn't find anything that does this. I don't

Re: [go-nuts] Dependency hell with Go modules

2019-01-18 Thread roger peppe
This is a good illustration of something I've been concerned about for a while: the fact that pulling in a package also pulls in all testing dependencies of that package recursively. To take github.com/hashicorp/vault/api as an example, I made this little module: -- main.go --

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread Robert Johnstone
Hello, Just to paint the bikeshed... The -er suffix makes sense for methods that follow the convention of naming methods after verbs. Forget io.Reader for a moment, and think of os.File. When you call the method Read, you are asking the instance to read from the file on disk. myvar.Read

[go-nuts] When marshalling values, should panics be preserved?

2019-01-18 Thread Robert Johnstone
Hello, I'm working on a GUI library, and one of the facilities provided is a way to execute code on the GUI thread. The call site is pretty simple: err := Do(func() error { // Inside this closure, we will be executing only on the GUI thread. _, err := fmt.Println("Hello.") //

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread Victor Giordano
I shall agree that most natural languages have a grammar far complex than the required to communicate the important things of life, and would say that tweaking it a little bit we should not having this thread. But is the nature of system guided by humans often is not to correct the core problem,

[go-nuts] Accessing the build cache

2019-01-18 Thread Jan B
Hey guys, Is there any way to access go's build cache? Specifically, i want to check if the source files of my program have changed (i.e. it needs to be recompiled). I've searched through the go tools but couldn't find anything that does this. Thanks! -- You received this message because

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread Robert Engels
There are *Nullable interfaces in the stdlib. Do what you want - no one will care, sort of. I agree that able is far more readable, and also defacto in other languages. In Go they often do things, because well, it’s Go, and they do things. You just have to get past it. I think the Go designers

Re: [go-nuts] When to use interfaces?

2019-01-18 Thread Sam Whited
On Fri, Jan 18, 2019, at 18:06, 伊藤和也 wrote: > When to use interfaces? Reading this chapter in Effective Go might help. You can find answers to many of your questions there. https://golang.org/doc/effective_go.html#interfaces_and_types —Sam -- You received this message because you are

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread robert engels
Yes, the method should be called read() - the debate is if it should be Reader or Readable. I prefer the able because it says to me, if something implements Readable, then any methods defined by Readable I can call - regardless of the method name. It gets more important for interfaces like

Re: [go-nuts] When marshalling values, should panics be preserved?

2019-01-18 Thread Ian Lance Taylor
On Fri, Jan 18, 2019 at 8:59 AM Robert Johnstone wrote: > > I'm working on a GUI library, and one of the facilities provided is a way to > execute code on the GUI thread. The call site is pretty simple: > > err := Do(func() error { > // Inside this closure, we will be executing only on the

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread Andy Balholm
The -er suffix makes sense when you think of a method invocation as a command, telling an object to do something. This was definitely the model in Smalltalk, where people called them “messages.” In Go, methods are more like functions than in Smalltalk, but some of the idea remains in the naming

[go-nuts] When to use interfaces?

2019-01-18 Thread 伊藤和也
When to use interfaces? -- 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+unsubscr...@googlegroups.com. For more options, visit

Re: [go-nuts] Re: multiple binaries from a single directory with go modules?

2019-01-18 Thread Tyler Compton
What alternative do you recommend? On Fri, Jan 18, 2019 at 4:53 PM Space A. wrote: > Yes/ Don't use make and makefiles. > > > >> Is there some clever way of structuring a project like this with go >> modules that I haven't figured out yet? >> >> Thanks, >> >> Tycho >> > -- > You received this

Re: [go-nuts] Using "er" and "able" for interfaces

2019-01-18 Thread Frank Dunn
Readable is an adjective as in "This is a readable comment." Reader is a noun as in "Frank is a reader of comments." Read is a verb as in "Read this comment." So what part of speech would interfaces be? It seems in idiomatic Go they would be nouns that can take action. i.e. things that

Re: [go-nuts] Re: multiple binaries from a single directory with go modules?

2019-01-18 Thread Sam Whited
On Sat, Jan 19, 2019, at 01:12, Tyler Compton wrote: > What alternative do you recommend? Use what you're comfortable with. Make is a great tool, and doesn't appear to be the problem here. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-18 Thread Ian Denhardt
You could just do: go build ./cmd/... cp ./cmd/foo/foo ./ cp ./cmd/bar/bar ./ ..and wrap it up in a script. Quoting Tycho Andersen (2019-01-17 17:47:35) > Hi everyone, > > I'm trying to get an existing project which outputs multiple binaries > to work with go modules. The package follows

[go-nuts] Re: multiple binaries from a single directory with go modules?

2019-01-18 Thread Space A.
Yes/ Don't use make and makefiles. > Is there some clever way of structuring a project like this with go > modules that I haven't figured out yet? > > Thanks, > > Tycho > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from