[go-nuts] Re: syscall/js: JS Module Dynamic Imports?

2020-09-29 Thread Alvadron
This is what I have been doing and it has worked for my needs: ``` // Importing it using "require" and storing the module in a variable core := js.Global().Call("require", "@boostercloud/framework-core") // Now get some props/methods from that module as usual: config := core.Get("Booster").Get("co

[go-nuts] Re: [generics] How to use maps in generic structs?

2020-08-10 Thread Alvadron
The type of map keys in Go should be comparable. As you haven't specified any restriction to the type parameters, it doesn't compile because Go doesn't know whether K and V are comparable. If you add the restriction "comparable", then it compiles: type BiMap[type V, K comparable] struct { forw