Re: [go-nuts] Intercepting field access and method call

2020-04-11 Thread Tanmay Das
Hi, thanks for your reply. I am still in the learning phase and when I learn the usage of a new tool I try to keep notes of *what's allowed *and *what's not allowed* by that tool. That's all :) So at this moment, it's not possible for me to come up with a concrete production-level use case.

Re: [go-nuts] Intercepting field access and method call

2020-04-11 Thread Kurtis Rader
On Sat, Apr 11, 2020 at 7:59 PM Tanmay Das wrote: > Say you have a struct Foo and you access fields and call methods on it as > you normally would. But is it possible to execute a hook before or after > that field access or method call? A good scenario will be: > > The user calls non-existent

[go-nuts] Intercepting field access and method call

2020-04-11 Thread Tanmay Das
Say you have a struct Foo and you access fields and call methods on it as you normally would. But is it possible to execute a hook before or after that field access or method call? A good scenario will be: The user calls non-existent method foo.Bar() or accesses non-existent field foo.Bar. If

Re: [go-nuts] correction in make documentation

2020-04-11 Thread Rob Pike
It's not just the size, though, it's also what kind of thing gets made. I think it's better as is. -rob On Sun, Apr 12, 2020 at 6:02 AM Feroz Jilla wrote: > Hello community :) > > I was going through the golang documentation on the `make` function here - >

[go-nuts] Tools for managing licenses of dependencies

2020-04-11 Thread Victor Denisov
Hi, Are there any tools that would allow to manage licenses of my go modules? I would like to be able to specify what licenses of my dependencies are allowed. Are there any plans to add something like this to standard go tools? Thanks, Victor. -- You received this message because you are

[go-nuts] correction in make documentation

2020-04-11 Thread Feroz Jilla
Hello community :) I was going through the golang documentation on the `make` function here - https://golang.org/pkg/builtin/#pkg-constants. I think the line "The specification of the result depends on the type:" should instead be "The specification of the size depends on the type:". (Changed

[go-nuts] Re: [ANN] GoGi, Gide, emergent version 1.0

2020-04-11 Thread Fino
Thank you! really nice to see any work in GUI area! 在 2020年4月10日星期五 UTC+8下午4:05:39,Randall O'Reilly写道: > > The GoGi GUI system https://github.com/goki/gi has now been released at > version 1.0 -- the 3D framework is now in place and interoperates with the > 2D framework (including embedding 2D

[go-nuts] Re: godoc (golang.org/x/tools/cmd/godoc) has become module-aware

2020-04-11 Thread Hein Meling
Maybe the godoc command got installed in your $HOME/go/bin folder and this folder is not in your $PATH? -- 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

Re: [go-nuts] Re: Why is this?

2020-04-11 Thread Josh Kamau
Thanks Brian, That makes sense. Josh On Sat, 11 Apr 2020 at 17:26, Brian Candler wrote: > Slightly extended: > https://play.golang.org/p/dVhNGS0oxKV > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and

[go-nuts] Re: Why is this?

2020-04-11 Thread Brian Candler
Slightly extended: https://play.golang.org/p/dVhNGS0oxKV -- 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. To view this

[go-nuts] Re: Why is this?

2020-04-11 Thread Brian Candler
You can think of an interface variable as a hidden struct: in pseudo-C, something like struct { void *data; type_info *type; } If you assign a map to this (even a nil map), it still has a concrete type. "data" is nil, but "type" is "map[X]Y" Therefore the interface variable itself is

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-11 Thread Tom Payne
Testing code that uses the os and ioutil packages is tricky. I created https://pkg.go.dev/github.com/twpayne/go-vfs https://pkg.go.dev/github.com/twpayne/go-vfs/vfst to make it easier. Key features: - Everything eventually calls the underlying os/ioutil function, so you get real behavior,

[go-nuts] Why is this?

2020-04-11 Thread Josh Kamau
package main import ( "fmt" ) func main() { fmt.Println(isInputNil(nil)) //Returns true fmt.Println(isMapNil(nil)) //Returns false } func isMapNil(m map[string]interface{}) bool { return isInputNil(m) } func isInputNil(input interface{}) bool { return input == nil }

Re: [go-nuts] Re: How to know if interface{} data is nil w/o reflecting?

2020-04-11 Thread Robert Engels
I agree with the OP. The usefulness of nil interfaces is pretty limited. Show me a useful case that cant easily be implemented with non-nil interfaces. I would argue that allowing nil interfaces causes more subtle latent bugs and makes it harder to reason about the correctness of code when

Re: [go-nuts] Re: How to know if interface{} data is nil w/o reflecting?

2020-04-11 Thread 'Axel Wagner' via golang-nuts
On Fri, Apr 10, 2020 at 7:17 PM wrote: > I realize I'm reviving an age-old discussion here and apologize for > bringing up the undead. I happend to run into this when my application > panicked when some interfaces where initialized with nil mock objects > instead of being left uninitialized as

[go-nuts] Re: Is it possible to segment CMD window on Windows and segment Terminal window on Linux with golang?

2020-04-11 Thread Mandolyte
Might review how the micro editor handles it... as an editor functioning in a terminal window and cross platform, it is quite stellar. https://pkg.go.dev/mod/github.com/zyedidia/micro@v1.4.1 On Friday, April 10, 2020 at 6:49:12 AM UTC-4, Jason E. Aten wrote: > > If you insist on terminal (which