[go-nuts] Re: What is the difference between (*mytype).fun and m := {}; m.fun

2017-05-05 Thread T L
On Saturday, May 6, 2017 at 9:05:16 AM UTC+8, be...@qoorp.com wrote: > > Greetings, > > I am using a package that has documented the use of a function liker this: > router.Middleware((*WebContext).CORSHeaders) > > Thaat works. When I do: > > (*mytype).fun has one more parameter than

Re: [go-nuts] understanding utf-8 for a newbie

2017-05-05 Thread Andy Balholm
Hexdump shows the actual bytes in the file—the UTF-8 encoding of the runes (Unicode code points). Apparently you are reading them with utf8.DecodeRune or something like that; those return the code points, without the UTF-8 encoding. Andy -- You received this message because you are subscribed

[go-nuts] Re: [ANN] gos2: S2 geometry library in Go

2017-05-05 Thread djadala
Hi, this package is moved to https://github.com/golang/geo just in case you don't noticed. Djadala On Saturday, May 6, 2017 at 4:03:25 AM UTC+3, Matthew Hoggan wrote: > > I am trying to find a group associated with > https://code.google.com/archive/p/s2-geometry-library/. This is the only >

[go-nuts] understanding utf-8 for a newbie

2017-05-05 Thread rob solomon
Hi. I decided to write a small program in Go to convert utf8 to simple ASCII. This need arose by my copying a file created in Ubuntu 16.04 amd64, and used on a win10 computer. I decided to first change ", ' and emdash characters. Using hexdump -C in Ubuntu, the runes in the file are:

[go-nuts] What is the difference between (*mytype).fun and m := {}; m.fun

2017-05-05 Thread bengt
Greetings, I am using a package that has documented the use of a function liker this: router.Middleware((*WebContext).CORSHeaders) Thaat works. When I do: -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

[go-nuts] Re: pure-Go MATLAB file I/O package ?

2017-05-05 Thread elia . maracani
Hi Sebastien, I'm writing a program that needs to do the exact same thing you were asking, have you by any chance developed that library? :P On Thursday, 7 July 2016 11:27:36 UTC+2, Sebastien Binet wrote: > > hi there, > > before I go ahead and implement it, has anyone released a pure-Go >

Re: [go-nuts] Re: os.exec.Command and non-nil return status

2017-05-05 Thread sebito91
Just wanted to give a quick +1 here, came in handy for a use-case just now! On Sunday, July 3, 2016 at 4:00:25 PM UTC-4, soapboxcicero wrote: > > Sorry for bumping an oldish thread, but I just ran into this trying to > propagate an exit code. > > I didn't find anything searching that was

[go-nuts] Re: [ANN] gos2: S2 geometry library in Go

2017-05-05 Thread mhoggan via golang-nuts
I am trying to find a group associated with https://code.google.com/archive/p/s2-geometry-library/. This is the only post that comes up when searching groups. My question on the library is, Do the bounding polygons associated with a cell id include the boundaries or sides of the polygon? If so

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread occitan
Le jeudi 4 mai 2017 22:44:58 UTC+2, Ian Lance Taylor a écrit : > > I assert without evidence that for many people it would be confusing > to see a function call alone on the right hand side of an `=` when > that function may or may not be called. > Various languages like Perl, PHP, Ruby & zsh

Re: [go-nuts] Huge system RSS memory usage

2017-05-05 Thread Justin Israel
I also have done an image processing server in the past and used two different image library cgo bindings. Each one has its own specific way it manages the C memory and you can leak of you don't observe them. I am not familiar with the OpenCV binging though. Are you leaking any goroutines? How

[go-nuts] Re: Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread eZio Pan
Thank you Pierre Curto! You help me out! That's the answer I need!!! Thank you again! 在 2017年5月5日星期五 UTC+8下午7:58:53,Pierre Curto写道: > > Since S1 and S2 satisfy the Stringl interface just use that for your slice > type and you get something like (note that you do not need to specify the >

[go-nuts] Re: Should we use frameworks like Go IRIS based on fasthttp to create foundation of my web application or do I start create framework from scratch

2017-05-05 Thread Simon Ritchie
A web framework that matches what you want to do will save you time. The trick is to spend less time evaluating frameworks than you save by using one. You could try mine. It's very simple, produces some useful basic stuff and doesn't force too many decisions onto you:

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread roger peppe
On 5 May 2017 at 14:11, Michael Jones wrote: > Just so. One cannot do boolean arithmetic with boolean variables. > > We have: > EQUIVALENCE ("==") > XOR ("!=") > NOT ("!") -- George Boole's NEGATION > > We lack: > AND ("&") -- George Boole's CONJUNCTION > OR

[go-nuts] suggest: improve go gen intergration for non core code ?

2017-05-05 Thread mhhcbon
Hi, just a suggestion to improve go gen adoption rate, maybe. go generate is not included in the go build pipeline, for good reasons, especially for the core code. It s a two step command, 1- go gen 2- go build Although, since vendoring is implemented, I think it would be good to re think its

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread Michael Jones
Just so. One cannot do boolean arithmetic with boolean variables. We have: EQUIVALENCE ("==") XOR ("!=") NOT ("!") -- George Boole's NEGATION We lack: AND ("&") -- George Boole's CONJUNCTION OR ("|") -- George Boole's DISJUNCTION As it happens, one can implement all the operators

Re: [go-nuts] go get + build flag to set version var

2017-05-05 Thread mhhcbon
sorry, mistake, ** My point is not criticize, but the way you describe the *how* that pipeline should happen IRL. That desciption seems taken from controlled environment such as - internal company - oss distro On Friday, May 5, 2017 at 2:57:44 PM UTC+2, mhh...@gmail.com wrote: > > yeah i agree.

Re: [go-nuts] go get + build flag to set version var

2017-05-05 Thread mhhcbon
yeah i agree. But (:/), i think its pipeline issue in the consumption of a go package. In the same way the language is made to prevent user errors (as much as possible, and its difficult) that go get pipeline usage should help in that matter too. My point is not criticize, but the way you

Re: [go-nuts] go get + build flag to set version var

2017-05-05 Thread Jakob Borg
On 5 May 2017, at 14:41, mhhc...@gmail.com wrote: > > Just to add on this that the fact i provide pre built bin is not winning > against go get, > > The repo i took as example is providing, > https://github.com/mh-cbon/emd/releases > > and all possible ways to install it i can provide, >

Re: [go-nuts] go get + build flag to set version var

2017-05-05 Thread mhhcbon
Just to add on this that the fact i provide pre built bin is not winning against go get, The repo i took as example is providing, https://github.com/mh-cbon/emd/releases and all possible ways to install it i can provide, https://github.com/mh-cbon/emd#install So yeah i did my best, i loosed.

Re: [go-nuts] go get + build flag to set version var

2017-05-05 Thread mhhcbon
I totally agree with you and implemented such build pipeline. But still, the fact is i have such situation, I might run after each and every ticket like this, that does not seem a run i can win ;) On Friday, May 5, 2017 at 2:21:58 PM UTC+2, Jakob Borg wrote: > > For end users I strongly

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread Ian Lance Taylor
On Fri, May 5, 2017 at 12:51 AM, roger peppe wrote: > On 4 May 2017 at 20:48, Michael Jones wrote: >> What is *actually* missing is boolean operators for boolean types. > > Really? We've got !, &&, ||, != (xor), == (xnor). What's missing? In a sense

[go-nuts] Re: download link - 400 error code

2017-05-05 Thread peterGo
Please provide detailed instructions for reproducing your error. Are you usin an Iranian IP address? Peter On Friday, May 5, 2017 at 7:51:43 AM UTC-4, Abbas Naghdi wrote: > > I have a golang 1.8.1 . > but i can't download it . > > please fix error code 400 and 403 thanks . > > -- You received

[go-nuts] Huge system RSS memory usage

2017-05-05 Thread miha . dimec
Hi 1. System Ubuntu 16.04.1 LTS \n \l Linux G-00017 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Re: [go-nuts] go get + build flag to set version var

2017-05-05 Thread Jakob Borg
For end users I strongly recommend distributing a binary. That gives you the ability to tag it properly and to know what goes into it - your code, your dependencies, and the compiler used. Typically this would happen by vendoring and using a Makefile or build script in the repo, running on some

[go-nuts] go get + build flag to set version var

2017-05-05 Thread mhhcbon
Hi, For a program i provide a pre build binary built with go install --ldflags "-X main.VERSION=$VERSION" So when users met a problem they can report the version easily and certainty. the version variable is set by default to "0.0.0", could be empty string. What should be the cmd line to

[go-nuts] Re: Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread pierre . curto
Since S1 and S2 satisfy the Stringl interface just use that for your slice type and you get something like (note that you do not need to specify the variables types if you initialize them like you did). https://play.golang.org/p/pJHU0Dq8t6 Le vendredi 5 mai 2017 13:35:42 UTC+2, eZio Pan a

[go-nuts] Re: Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread Volker Dobler
See https://golang.org/doc/faq#convert_slice_of_interface V. On Friday, 5 May 2017 13:35:42 UTC+2, eZio Pan wrote: > > Hi, I'm a newbie in Golang. I get stuck in a problem that I can't > understand why. I wish someone could help me out. Thanks! > > There are 2 struct type *S1* and *S2*. Both of

[go-nuts] Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread eZio Pan
Hi, I'm a newbie in Golang. I get stuck in a problem that I can't understand why. I wish someone could help me out. Thanks! There are 2 struct type *S1* and *S2*. Both of them implement interface type *StringI*. I write a function called *run* which use *StringI* interface as input, and run

Re: [go-nuts] Isn't it better just to panic when you send/recv on a nil channel instead of forever blocking?

2017-05-05 Thread Mikhail Mazurskiy
Hi, I find it very useful to be able to dynamically turn certain cases in a select statement on and off. Here are two illustrations to Jesse's comment: https://github.com/atlassian/smith/blob/2599ad0760c39962ac9caa2c46fa23810b672384/pkg/processor/worker.go#L79

Re: [go-nuts] sort.SliceStable behaves incorrectly, but only sometimes!

2017-05-05 Thread Val
On Friday, May 5, 2017 at 11:57:58 AM UTC+2, Ondřej Kupka wrote: > > > Performing separate stable sorts on a partial key does not produce a > stable sort on the full key. > > I think that it does, when you sort from the last key to the first key. > > Intuitively I think too that it does, but

Re: [go-nuts] sort.SliceStable behaves incorrectly, but only sometimes!

2017-05-05 Thread Ondřej Kupka
> Performing separate stable sorts on a partial key does not produce a stable sort on the full key. I think that it does, when you sort from the last key to the first key. When I want to sort the slice by (Gateway, Channel, Device), then sorting by Device, then Channel, then Gateway using a

[go-nuts] Re: sort.SliceStable behaves incorrectly, but only sometimes!

2017-05-05 Thread Ondřej Kupka
Oh well, probably never mind, forgot to call the sorting function at one place, so that is likely the reason... -- 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] sort.SliceStable behaves incorrectly, but only sometimes!

2017-05-05 Thread Jan Mercl
On Fri, May 5, 2017 at 11:37 AM Ondřej Kupka wrote: > It seems that the slice is sometimes sorted properly and sometimes it isn't obviously sorted. How is that possible? Performing separate stable sorts on a partial key does not produce a stable sort on the full key. --

[go-nuts] sort.SliceStable behaves incorrectly, but only sometimes!

2017-05-05 Thread Ondřej Kupka
Hi, I have a slice of points: type Point strcut { Gateway string Channel int Devce int } Now I execute cc := make([]Point, 0) // Fill cc with points (skipped here). sort.SliceStable(cc, func(i, j int) bool { return cc[i].Device < cc[j].Device }) sort.SliceStable(cc, func(i,

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread roger peppe
On 4 May 2017 at 20:48, Michael Jones wrote: > What is *actually* missing is boolean operators for boolean types. Really? We've got !, &&, ||, != (xor), == (xnor). What's missing? > On Thu, May 4, 2017 at 12:43 PM, Ian Lance Taylor wrote: >> >> On Thu,