Re: [go-nuts] sync.Cond implementation

2018-04-18 Thread Penguin Enormous
Much appreciated for all the great advises from everyone. Or to be more precise: it is crucial you load wait before notify and the > check for equality can only happen if the routine "caught up". Also, your > proof must hold if you remove the fast-path check in line 522. > Why is it crucial to

[go-nuts] Fancy Comments & Documentation

2018-04-18 Thread Chris FractalBach
So, I'm one of those people who sometimes adds comments like this to my code: ++ | Program Title| | Author | |Date| ++ Synopsis, Description,

Re: [go-nuts] Re: Why not tuples?

2018-04-18 Thread Jan Mercl
On Thu, Apr 19, 2018 at 6:57 AM Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: > > func (b *Bast) Parent(c Cursor) Cursor { > if c.Index == 0 { > c.Err = errors.New("No parent from the root") > return c > } > c.Row-- > c.Index = c.Index>>1 - (c.Index+1)%2 > c.Err = nil > return c > } >

Re: [go-nuts] Extension for type assertion of interface array

2018-04-18 Thread nsakthi93
Usescases that I came across doesn't involve []interface{}. My usecases will be similar to this sample code type landSpace struct { //consider that landSpace implements all functions from both Shape and property interfaces ... } type Shape interface { ..

[go-nuts] Re: Why not tuples?

2018-04-18 Thread Louki Sumirniy
I think there is no really big reason to make a special tuple type for return values. The extra burden comes in specifying the type and wrapping the list in curly brackets, and predefining the elements in a type struct declaration. I am writing a dense binary tree implementation (dense as in no

Re: [go-nuts] (*net.TCPListener).File() switches to blocking mode

2018-04-18 Thread Ian Lance Taylor
On Wed, Apr 18, 2018 at 7:25 PM, Steven Roth wrote: > > I just wrote some code for graceful restart of a web server, following > models available on the web. Unlike those models, my code didn't work. The > parent (old) web server refused to exit. The call to server.Shutdown > returned success,

[go-nuts] http "alt" attribute value for img tag?

2018-04-18 Thread l vic
I need to get "alt" value from html "img" tag: ... message What would be the correct way in Go to read "alt" values into array? Thank you, -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

[go-nuts] (*net.TCPListener).File() switches to blocking mode

2018-04-18 Thread Steven Roth
I just wrote some code for graceful restart of a web server, following models available on the web. Unlike those models, my code didn't work. The parent (old) web server refused to exit. The call to server.Shutdown returned success, and the listener got closed, but the server.Serve call never ret

Re: [go-nuts] The Go code formatter

2018-04-18 Thread Jérôme LAFORGE
I have already confronted to this problem with table driven test. -- 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 m

[go-nuts] Any golang ORM that supports Vertica VSQL?

2018-04-18 Thread Big K
Does anyone know of a ORM library for golang that supports Vertica VSQL? Thanks -- 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...@googlegro

[go-nuts] Re: code structure question

2018-04-18 Thread Keith Brown
I like the idea of putting each command in an ishell.Cmd. Yeah, I wasn't sure about the struct. Basically, I wanted an easy way to map my code so, I was thinking a yaml file (I suppose I can create a struct from it). - clear - greet - user - (no user) #if no user is specified then greet al

[go-nuts] Re: Extension for type assertion of interface array

2018-04-18 Thread matthewjuran
I think if you opened a proposal it would be merged into the generics discussion: https://github.com/golang/go/issues/15292 There may be other ways to write the program, can you provide a concrete example of where you’ve needed this? Matt On Wednesday, April 18, 2018 at 9:13:59 AM UTC-5, Sakth

Re: [go-nuts] Extension for type assertion of interface array

2018-04-18 Thread Jan Mercl
On Wed, Apr 18, 2018 at 4:22 PM Jan Mercl <0xj...@gmail.com> wrote: > On Wed, Apr 18, 2018 at 4:13 PM wrote: > > When possible, avoid using '[]interface{}' and use just 'interface{}' > instead: https://play.golang.org/p/oPtPoGChkMZ. > > > The link should have been: https://play.golang.org/p/aLKIx

Re: [go-nuts] Extension for type assertion of interface array

2018-04-18 Thread Jan Mercl
On Wed, Apr 18, 2018 at 4:13 PM wrote: When possible, avoid using '[]interface{}' and use just 'interface{}' instead: https://play.golang.org/p/oPtPoGChkMZ. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

[go-nuts] Extension for type assertion of interface array

2018-04-18 Thread nsakthi93
Go supports below type assertion t := i.(T) and t, ok := i.(T) Can this feature be extended to array of interfaces as mentioned below? t := i.([]T) and t, ok := i.([]T) I have been using Golang for almost four years and I have come across use cases requi

Re: [go-nuts] Usage example inside a lib project

2018-04-18 Thread matthewjuran
An example directory works too and is pretty common. Matt On Wednesday, April 18, 2018 at 7:45:45 AM UTC-5, Federico Paolinelli wrote: > > Il giorno mercoledì 18 aprile 2018 08:41:30 UTC-4, Jan Mercl ha scritto: >> >> On Wed, Apr 18, 2018 at 2:35 PM Federico Paolinelli >> wrote: >> >> See https

[go-nuts] Re: code structure question

2018-04-18 Thread matthewjuran
Consider putting each ishell.Cmd in a separate file. Otherwise you can put them in a slice var so you don’t have to AddCmd each one explicitly. I’m not sure what defining a struct accomplishes, can you provide more detail? Matt On Tuesday, April 17, 2018 at 8:25:17 PM UTC-5, Keith Brown wrote:

Re: [go-nuts] Usage example inside a lib project

2018-04-18 Thread Federico Paolinelli
Il giorno mercoledì 18 aprile 2018 08:41:30 UTC-4, Jan Mercl ha scritto: > > On Wed, Apr 18, 2018 at 2:35 PM Federico Paolinelli > wrote: > > See https://golang.org/pkg/testing/#hdr-Examples. Put the examples into > the foo_test.go file. > > > Oh, didn't realize that it was a convention. Thanks a

Re: [go-nuts] Usage example inside a lib project

2018-04-18 Thread Jan Mercl
On Wed, Apr 18, 2018 at 2:35 PM Federico Paolinelli wrote: See https://golang.org/pkg/testing/#hdr-Examples. Put the examples into the foo_test.go file. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group an

[go-nuts] Creating snap app using Go

2018-04-18 Thread Kaveh Shahbazian
How one should make a snap app using Go (1.10.1)? The snapcraft tool uses Go 1.6. -- 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...@googleg

[go-nuts] Usage example inside a lib project

2018-04-18 Thread Federico Paolinelli
Hi everyone, I am pretty new to golang and I have the following question. I developed a lib for internal use here at work. It has it's own package and tests inside the git repo. Now, I would like to add an example of how to use it, but if I add a package main file it will be interpreted as a com

Re: [go-nuts] [ANN] Slowpoke (database engine)

2018-04-18 Thread recoilme
Keys storage not grow, they are overriding on an update, values override too if size of old value is sufficient If no - it will grow. I have plans to add compaction on backup in future. Right now backup may be implemented in three command (sets(gets(keys( > On 18 Apr 2018, at 11:31, Sokolov

Re: [go-nuts] question about asm doc

2018-04-18 Thread buaa . cch
I also wonder if there are some official doc about this stack layout on amd64.. 在 2018年4月18日星期三 UTC+8上午3:48:46,Ian Lance Taylor写道: > > On Tue, Apr 17, 2018 at 9:46 AM, > > wrote: > > here: > > https://github.com/golang/go/files/447163/GoFunctionsInAssembly.pdf > > OK, you'll have to ask Mich

Re: [go-nuts] The Go code formatter

2018-04-18 Thread Ali Altun
A lof of similar situation, this kind of formating approach is needed. For example, the unformatted (or more precisely the manual formatted part) is mode readable for me. It may not be objective. // Before Go gofmt'ed aTempl := []map[string]interface{}{ > {"fname": "id", "

Re: [go-nuts] The Go code formatter

2018-04-18 Thread Ali Altun
aTempl := []map[string]interface{}{ {"fname": "id", "label": "Id", "boyut4": "01"}, {"fname": "exp", "label": "Exp", "boyut4": "02"}, {"fname": "atarih", "label": "Atarih", "boyut4": "05"}, {"fname": "kimlk", "label": "Kimlik", "boyut4": "03"}, {"fname":

Re: [go-nuts] The Go code formatter

2018-04-18 Thread Jan Mercl
On Wed, Apr 18, 2018 at 1:24 PM Ali Altun wrote: > There is a code part in the https://golang.org/pkg/sort/#example_ > The Go code formatter doesn't change this code. The code is already gofmt'ed, so no change is expected. > Similarly, how can I make it leave the following code snippet unchange

[go-nuts] The Go code formatter

2018-04-18 Thread Ali Altun
There is a code part in the https://golang.org/pkg/sort/#example_ The Go code formatter doesn't change this code. func (a ByAge) Len() int { return len(a) } > func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] } > func (a ByAge) Less(i, j int) bool { return a[i].Age < a[j].Age } > Similarl

Re: [go-nuts] math/big oddities

2018-04-18 Thread agruetz45
Jakob, Thank you. I knew I had to be missing some nuance of how to use the library correctly. Thanks, Anthony On Wednesday, April 18, 2018 at 1:44:13 AM UTC-7, Jakob Borg wrote: > > That is a much too large value to be precisely represented by a float64. > You need more bits, and you need to t

Re: [go-nuts] math/big oddities

2018-04-18 Thread Jakob Borg
That is a much too large value to be precisely represented by a float64. You need more bits, and you need to tell big.Float how many bits that is: https://play.golang.org/p/btm6-_9NQgB //jb On 18 Apr 2018, at 09:57, agruet...@gmail.com wrote: I have been playing wit

[go-nuts] Re: [ANN] Slowpoke (database engine)

2018-04-18 Thread Sokolov Yura
How it is compacted? Values will be updated and deleted, storage file will grow. How garbage will be collected? вторник, 17 апреля 2018 г., 14:37:27 UTC+3 пользователь vadim kulibaba написал: > > Hi Everyone, > > I finished simple and effective key/value store with nice api: > https://github.com

[go-nuts] math/big oddities

2018-04-18 Thread agruetz45
I have been playing with the karatsuba algorithm and was doing some testing testing to compute the correct values of two large numbers 3141592653589793238462643383279502884197169399375105820974944592 and 2718281828459045235360287471352662497757247093699959574966967627. When working with the mat