>
> Use an array instead of a slice. An array has a fixed size and can be used
> as a key to a map
>
> https://play.golang.org/p/xxxmrwpx08A
>
This seem to not work. The arr is returning only duplicate elements in your
playground url.
For example:
var arr [][]int
for mem := range m {
fmt.
Is the visual code studio an compiler or a what, I tried it myself but I
isn't able to program.
--
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+unsu
rm -rf ~/go/src
Then extract again.
--
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 https://grou
On Tue, 22 May 2018 10:59:24 -0700 Sankar wrote:
>
> Is there a way to use a slice as a key to a map ? If I try, I get a
> compilation error: `invalid map key type`.
>
> I tried creating a custom type, which contains an array as the element.
> However, I could not find out what method to impl
That clarifies it. Thanks!
On Tuesday, May 22, 2018 at 5:29:43 PM UTC-7, alex@gmail.com wrote:
>
> https://golang.org/ref/spec#Select_statements
>
> Execution of a "select" statement proceeds in several steps:
>>
>>1. For all the cases in the statement, the channel operands of
>>recei
https://golang.org/ref/spec#Select_statements
Execution of a "select" statement proceeds in several steps:
>
>1. For all the cases in the statement, the channel operands of receive
>operations and the channel and right-hand-side expressions of send
>statements are evaluated exactly o
This is interesting and I still don't get why it's not working.
I modified the code a bit and expected it to immediately break out of
select but it still waits for http calls to finish
https://play.golang.org/p/z1mmqpQtOre
package main
import (
"errors"
"fmt"
"net/http"
"net/http/httptest"
"ti
Hi, I'm having trouble updating the version through source code.
export GOROOT_BOOTSTRAP=/home/lucas/go1.4
export GOROOT=$HOME/go
export GOPATH=$HOME/workspace-go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
$ go version
go version go1.8.3 linux/amd64
When i run ./all.bash
$ ./all.bash
Building
I have a rather simple request - I am not sure if this already exists but
I'd like to avoid typing "\n" everytime I do Printf( ) even though I quite
enjoy doing that. Is there an inbuilt library function that does this?
Thanks
Anirudh
--
You received this message because you are subscribed to
Hi
I am reading the design of go scheduler, and don't quite understand this in
"Scalable Go Scheduler Design Doc"
https://docs.google.com/document/d/1TTj4T2JO42uD5ID9e89oa0sLKhJYD0Y_kqxDv3I3XMw/edit#
Spinning is mostly passive (yield to OS, sched_yield()), but may include a
> little bit of act
Hi -
I want to have a Printfln on log and fmt - Currently I use fmt.Printf( "
yada yada \n", some_yada_yada) to achieve same effect. Is there a plan to
add this simple yet extremely useful function?
Thanks
Anirudh
--
You received this message because you are subscribed to the Google Groups
Hello, here’s a code review. Thanks for sharing here.
These are my unfiltered opinions that may be wrong, and I hope they are
useful for you.
Have you considered including an open source license like BSD? There’s a
base GitHub license applied now.
func CreateRelative(
path string,
conf
On Wed, May 23, 2018, 5:59 AM Sankar wrote:
> Is there a way to use a slice as a key to a map ? If I try, I get a
> compilation error: `invalid map key type`.
>
> I tried creating a custom type, which contains an array as the element.
> However, I could not find out what method to implement for m
No, sorry, slices cannot be used as map keys.
Also note that equality is not dependent on methods
and not user changeable but solely determined by
the language spec.
If you can derive e.g. a string from the slice and use
that string as the map key you would be fine.
V.
On Tuesday, 22 May 2018 19
Tangentially related (I think): https://github.com/golang/go/issues/24751
On Tue, 22 May 2018 at 19:10, Nate Finch wrote:
> Forgive me if this has been answered somewhere. I tried to divine it from
> Russ' documents, but I couldn't really tell.
>
> Do vanity imports change dramatically with vgo
Forgive me if this has been answered somewhere. I tried to divine it from
Russ' documents, but I couldn't really tell.
Do vanity imports change dramatically with vgo? Currently, all I have to
do to support a vanity import is to return a page at
https://gnorm.org/gnorm that has a meta element
Is there a way to use a slice as a key to a map ? If I try, I get a
compilation error: `invalid map key type`.
I tried creating a custom type, which contains an array as the element.
However, I could not find out what method to implement for my custom
type(such as: func (i *myType) Equal(j *my
The execution tracer will show this as it tracks resources that goroutines
block on.
Seriously I’m just going to keep suggesting the execution tracer until you try
it :)
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this
On Tue, May 22, 2018 at 12:21 AM, Hawari Rahman
wrote:
> Hi Burak,
>
> Thank you for your reply,
> Inside the HydrateCollection function there are database queries (at least
> three), run using the same *sql.DB throughout the application.
>
>> Is it possible that
>> whatever connection HydrateColl
I've found a solution, but it's not as nice as interfaces:
Injectable function type:
func(l *eventlog.Log, eid uint32, msg string) error
Struct methods convert directly to this type without wrappers: (*
eventlog.Log).Info and (*eventlog.Log).Error
On Tuesday, May 22, 2018 at 12:46:28 PM UTC+2, e
Let's say I want to unit test code that is using
eventlog.Open: https://godoc.org/golang.org/x/sys/windows/svc/eventlog#Open
First I define an interface that matches eventlog.Log:
type WindowsEventLogger interface {
Info(eid uint32, msg string) error
Error(eid uint32, msg string) error
}
Will this help? https://github.com/aaronbriel/jsonjunit
I haven't tried it but piping the json output to jsonjunit can help.
On Saturday, 19 May 2018 19:55:24 UTC+5:30, Vedu Joshi wrote:
>
> I see that in go1.10, we can have json formatted "go test" output (by
> using -json flag)
> I googled aro
Hi Dave,
Yeah, I guess that's the way I'm going to go now. By the way, about the
usage of the channels in my snippet, is there any catch from that?
On Tuesday, May 22, 2018 at 3:46:13 PM UTC+7, Dave Cheney wrote:
>
> The best tool to investigate this problem is the execution tracer. It will
> s
Hi Justin,
Yes, it is using index scan, which makes me even more puzzled.
On Tuesday, May 22, 2018 at 3:45:29 PM UTC+7, Justin Israel wrote:
>
>
>
> On Tue, May 22, 2018, 6:35 PM Hawari Rahman > wrote:
>
>> After some more detailed investigation, it seems the most time consuming
>> process is a
The best tool to investigate this problem is the execution tracer. It will show
you the activity of goroutines over time making is easy to spot contention.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
On Tue, May 22, 2018, 6:35 PM Hawari Rahman
wrote:
> After some more detailed investigation, it seems the most time consuming
> process is a "Select by IDs" query. So to hydrate a Collection object, I
> need to retrieve another objects through a SELECT WHERE id = ANY(?)" query
> in postgres. I'm
26 matches
Mail list logo