Re: [go-nuts] Re: Gracefully Shutdown File Server

2017-03-13 Thread amkguo
Maybe this is a bug or need clear documentation about this. I've filed a bug report here: https://github.com/golang/go/issues/19541 Andrew -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] dep: Roadmap for merging into the toolchain

2017-03-13 Thread Sam Boyer
Hi Russ - thanks, this is great. I think all of this will be much easier with these discussions happening in the open. On Monday, March 13, 2017 at 5:09:19 PM UTC-4, Russ Cox wrote: > > On Tue, Mar 7, 2017 at 6:47 AM, Sam Boyer > wrote: > >> Hi folks, >> >> Since we

[go-nuts] Re: Does sync.Cond call Lock() twice on the underlying Locker?

2017-03-13 Thread Albert Tedja
Ugh. It makes sense now. cond.L.Lock() gets called from the first goroutine, then immediately followed by another Lock() from the second. Therefore, in order to properly implement Lock(), it actually has to be blocking. On Monday, March 13, 2017 at 4:35:04 PM UTC-7, dja...@gmail.com wrote: >

Re: [go-nuts] cross compile windows from linux failed with -H=windowsgui

2017-03-13 Thread brainman
I think we should just get rid of Hwindowsgui. I am pretty sure it is only different from Hwindows in one place in cmd/link. I will try and implement this when I have time. Alex -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Re: Does sync.Cond call Lock() twice on the underlying Locker?

2017-03-13 Thread djadala
On Tuesday, March 14, 2017 at 12:10:31 AM UTC+2, Albert Tedja wrote: > > I am writing a custom Locker which does a check if Lock() is being called > more than once and throws a panic if it does. > I tested it to see if I can use it with sync.Cond, and for the most part, > it was running as

[go-nuts] Re: Does sync.Cond call Lock() twice on the underlying Locker?

2017-03-13 Thread Albert Tedja
$ go version go version go1.8 linux/amd64 -- 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

[go-nuts] Does sync.Cond call Lock() twice on the underlying Locker?

2017-03-13 Thread Albert Tedja
I am writing a custom Locker which does a check if Lock() is being called more than once and throws a panic if it does. I tested it to see if I can use it with sync.Cond, and for the most part, it was running as intended, except once in a while the panic check triggered. Here's the dumbed down

Re: [go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread Jan Mercl
On Mon, Mar 13, 2017 at 10:10 PM 'simon place' via golang-nuts < golang-nuts@googlegroups.com> wrote: > i see Apache 2 licence file in the root.(github) That repository seems to contain only "Go driver for connecting to RSQL database server". I followed OP's link chain - http://rsql.ch/ -

Re: [go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread mhhcbon
https://github.com/rin01/rsql/blob/master/LICENSE did you mean the license is not packed into the dist archives ? in my concern i wonder where is the cli source, i can t find it. Also it is said to be 140k LOC, but i can t see them all in the repo, i must miss something. Are they the C part

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-13 Thread Dave Cheney
A few clarifications, b does not point to a. a and b are variables of type []int. The value of each slice's ptr fields point to a backing array of some capacity. If you append to a, this does not change th length or cap fields of b. If you do this enough times that ptr field of a will be

Re: [go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread 'simon place' via golang-nuts
i see Apache 2 licence file in the root.(github) -- 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,

Re: [go-nuts] dep: Roadmap for merging into the toolchain

2017-03-13 Thread Russ Cox
On Tue, Mar 7, 2017 at 6:47 AM, Sam Boyer wrote: > Hi folks, > > Since we opened up the dep project in > late January, there's been flurry of contributions, which has been great. > However, the plans and end goal of dep haven't been

Re: [go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread John McKown
On Mon, Mar 13, 2017 at 3:36 PM, Jan Mercl <0xj...@gmail.com> wrote: > > On Mon, Mar 13, 2017 at 9:13 PM nicolas riesch > wrote: > > > But it would help me to have your first impression or opinion on this > project. > > Sounds very very interesting, but... Here are the

Re: [go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread Jan Mercl
On Mon, Mar 13, 2017 at 9:13 PM nicolas riesch wrote: > But it would help me to have your first impression or opinion on this project. Sounds very very interesting, but... Here are the first impressions: - I can see no LICENSE or similar file in the root directory. I

[go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread nicolas riesch
I have developed RSQL, a *lighweight clone of Microsoft SQL Server*, which runs on Linux and can execute T-SQL scripts. It has been successfully tested with millions of records. The source code is *written in Go*, and contains 140,000 lines. It would help me very much if some of you could

[go-nuts] Re: Add Equals to sort.Interface?

2017-03-13 Thread pauledwardbuis
See https://github.com/zephyrtronium/sort/blob/master/2pqs.go for a dual pivot quicksort implementation that just uses Less without duplicate calls to Less to simulate Equals! On Thursday, December 3, 2009 at 8:05:04 PM UTC-5, baldmountain wrote: > > I was having a go at porting the dual pivot

Re: [go-nuts] cross compile windows from linux failed with -H=windowsgui

2017-03-13 Thread Ian Lance Taylor
On Mon, Mar 13, 2017 at 8:05 AM, wrote: > I use Kubuntu 16.10, when compile a project over to windows, I get this > error: > > crosscall2: adddynsym: unsupported binary format > _cgo_panic: adddynsym: unsupported binary format > _cgo_topofstack: adddynsym: unsupported binary

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-13 Thread xiiophen
On Monday, 13 March 2017 07:20:57 UTC, Jan Mercl wrote: > On Mon, Mar 13, 2017 at 8:05 AM st ov > wrote: > > > I know it can be accessed the question relates to this > > > http://stackoverflow.com/questions/36706843/how-to-get-the-underlying-array-of-a-slice-in-go > >

Re: [go-nuts] Re: Simple design question: method or function?

2017-03-13 Thread Peter Herth
One important difference is polymorphism/namespacing. If you have the types X,Y,Z, each of them could implement a Quack() method, while you would have to write a QuakX, QuakY, and QuakZ function, if you wanted to wanted to have the three different implementations. So the method approach looks and

[go-nuts] GO Developer Job Opportunity - CINCINNATI

2017-03-13 Thread Abby Recker
Hi everyone! One of my clients here in Cincinnati is looking for 3 GO Developers - high pay, great benefits, cool team. This position is a year long contract, which will then be converted to permanent. Please call/email Francesca or Andrew at my office for more details if you are interested at

[go-nuts] cross compile windows from linux failed with -H=windowsgui

2017-03-13 Thread xrfang
I use Kubuntu 16.10, when compile a project over to windows, I get this error: crosscall2: adddynsym: unsupported binary format _cgo_panic: adddynsym: unsupported binary format _cgo_topofstack: adddynsym: unsupported binary format adddynlib: unsupported binary format adddynlib: unsupported

[go-nuts] Re: thread safety of map when each goroutine access a different key

2017-03-13 Thread Marvin Stenger
Why do you even use a shared map, if you only use distinct keys per goroutine. There probably is a better pattern for your use case. Am Montag, 13. März 2017 07:39:59 UTC+1 schrieb Albert Tedja: > > Hello, > > I know map itself isn't threadsafe, but I am just wondering how threadsafe > it is if

[go-nuts] Re: How to pass value in nested template if possible?

2017-03-13 Thread mhhcbon
template func takes an extra argument to send data, {{ template "inner" .}}{{end}} I can t find a link to doc for that matter :s nothing here https://golang.org/pkg/text/template/#hdr-Nested_template_definitions or here https://golang.org/pkg/text/template/#hdr-Functions The only related

[go-nuts] How to pass value in nested template if possible?

2017-03-13 Thread Ilya Kostarev
How to pass value in nested template if possible? Template package has terse documentation and not much examples. In brief I want to if err := template.Must(template.New("").Parse(`{{ define "inner" }}{{ . }}{{end}}{{ define "outer" }}{{ template

[go-nuts] Re: thread safety of map when each goroutine access a different key

2017-03-13 Thread Haddock
Forgot to mention that ConcurrentHashMap has 256 segments (if I remember right). So you can have 256 map operations going on concurrently. Am Montag, 13. März 2017 11:58:15 UTC+1 schrieb Haddock: > > You can download Java (JDK5 or later) and have a look at class > ConcurrentHashMap. This will

[go-nuts] Re: thread safety of map when each goroutine access a different key

2017-03-13 Thread Haddock
You can download Java (JDK5 or later) and have a look at class ConcurrentHashMap. This will give you a blueprint about how this can be implemented using segments. After segment lookup for a given hash code only the segment needs to be locked, but not any more the entire map. Note, that you

Re: [go-nuts] thread safety of map when each goroutine access a different key

2017-03-13 Thread Albert Tedja
Great. Thanks! Looks like it's just better if I return a struct if these goroutines are operating independently anyway. On Monday, March 13, 2017 at 12:20:42 AM UTC-7, Konstantin Khomoutov wrote: > > On Sun, 12 Mar 2017 23:39:59 -0700 (PDT) > Albert Tedja wrote: > > > I

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-13 Thread st ov
just a thought experiment :) On Monday, March 13, 2017 at 12:20:57 AM UTC-7, Jan Mercl wrote: > > On Mon, Mar 13, 2017 at 8:05 AM st ov > wrote: > > > I know it can be accessed the question relates to this > > >

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-13 Thread Konstantin Khomoutov
On Sun, 12 Mar 2017 17:36:53 -0700 (PDT) st ov wrote: > > > What happens when appending to a slice exceeds the backing > > > capacity? > > > > If the capacity of s is not large enough to fit the additional > > values, append allocates a new, sufficiently large underlying

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-13 Thread Jan Mercl
On Mon, Mar 13, 2017 at 8:05 AM st ov wrote: > I know it can be accessed the question relates to this > http://stackoverflow.com/questions/36706843/how-to-get-the-underlying-array-of-a-slice-in-go Let me ask what do you need the backing array for which cannot be done using

Re: [go-nuts] thread safety of map when each goroutine access a different key

2017-03-13 Thread Konstantin Khomoutov
On Sun, 12 Mar 2017 23:39:59 -0700 (PDT) Albert Tedja wrote: > I know map itself isn't threadsafe, but I am just wondering how > threadsafe it is if you can be absolutely sure that each goroutine > accesses a different key in the map. > Say, goroutine 1 accesses mymap["1"]

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-13 Thread st ov
I know it can be accessed the question relates to this http://stackoverflow.com/questions/36706843/how-to-get-the-underlying-array-of-a-slice-in-go On Sunday, March 12, 2017 at 10:01:11 PM UTC-7, Jan Mercl wrote: > > What is a reference to the array? To access the array use the slice itself >

[go-nuts] thread safety of map when each goroutine access a different key

2017-03-13 Thread Albert Tedja
Hello, I know map itself isn't threadsafe, but I am just wondering how threadsafe it is if you can be absolutely sure that each goroutine accesses a different key in the map. Say, goroutine 1 accesses mymap["1"] and goroutine 2 accesses mymap["2"] and so on. Thank you in advance. -- You

Re: [go-nuts] json.Unmarshal and modifications to copies of structs

2017-03-13 Thread Nigel Tao
On Mon, Mar 13, 2017 at 9:10 AM, george.robinson via golang-nuts wrote: > Can someone explain to me how this prints "test world" twice? I had expected > to see "test hello" and "test world". > > https://play.golang.org/p/E7CRQNE6oT m1 is not a pointer, but m1.S is a