[go-nuts] [Proposal] database/sql: add interface that unite DB and Tx

2020-01-15 Thread Mhd Shulhan
## Problem At some point we have a function that receive an instance of database connection to query rows in specific table. Let's say that function F() accept DB that query table T. If function F() called with DB instance, it will query only rows that has been committed into database. IF fun

Re: [go-nuts] Quantum mechanics mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Michael Jones
🙂 On Wed, Jan 15, 2020 at 1:49 PM Dan Kortschak wrote: > Google Trends graph showing past 5y of Mechanic, Quantum mechanics > > > https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F03f_s3,%2Fm%2F069dx > > -- > You received this message because you are subscribed to the Google Gro

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Liam
That could affect the level of a term, but wouldn't impact its trend much. Trends are the important insight of this graph. On Wednesday, January 15, 2020 at 2:58:31 PM UTC-8, Robert Engels wrote: > > > Please look deeper into how these "trends" are calculated. > > For example, if everyone that us

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Robert Engels
Please look deeper into how these "trends" are calculated.For example, if everyone that uses product Y can't figure out how feature X works, and they search for it. Product Y will be showing growth...-Original Message- From: Liam Sent: Jan 15, 2020 4:18 PM To: golang-nuts Subject: [go-nut

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Daniela Petruzalek
If you look at python’s trajectory it took a while for it to become mainstream. I suppose Go’s curve will be somewhat similar. This is a very interesting talk on usage trends among programming languages: https://youtu.be/QyJZzq0v7Z4 On Wed, 15 Jan 2020 at 22:18 Liam wrote: > My point is that Go

[go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Liam
My point is that Go should be rising, since Java & C# are falling. Python has gained significant mindshare, and Go is way better. I think something's amiss with the public perception of Go, but it's hard to say what. On Wednesday, January 15, 2020 at 12:34:54 PM UTC-8, Liam wrote: > > Google Tr

[go-nuts] Quantum mechanics mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Dan Kortschak
Google Trends graph showing past 5y of Mechanic, Quantum mechanics https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F03f_s3,%2Fm%2F069dx -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Tom Payne
Thanks again - I'm learning a lot here! For info, the background here is that I've been writing code like: type T struct { SomeField int } func NewTFromJSON(data []byte) (*T, error) { var t T return &t, json.Unmarshal(data, &t) } which wraps up error handling into a si

[go-nuts] Go mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Liam
Google Trends graph showing past 5y of Java, Python, C#, Node.js, Go https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F07sbkfb,%2Fm%2F05z1_,%2Fm%2F07657k,%2Fm%2F0bbxf89,%2Fm%2F09gbxjr -- You received this message because you are subscribed to the Google Groups "golang-nuts" gr

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Ian Lance Taylor
On Wed, Jan 15, 2020 at 12:24 PM Tom Payne wrote: > > Thanks all for the insight and explanation. Could I suggest tweaking the Go > language specification to emphasize the separation, so it reads: > >"when evaluating the operands of an expression, assignment, or return > statement, then all

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Robert Engels
That is why this should be tightened down imo. It’s obscure cruft that needs to be accounted for when refactoring. > On Jan 15, 2020, at 2:23 PM, Tom Payne wrote: > >  > Thanks all for the insight and explanation. Could I suggest tweaking the Go > language specification to emphasize the sepa

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Tom Payne
Thanks all for the insight and explanation. Could I suggest tweaking the Go language specification to emphasize the separation, so it reads: "when evaluating the operands of an expression, assignment, or return statement, *then* all function calls, method calls, and communication operations are

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Robert Engels
I disagree here. Knowing the order of operations/evaluation is part of knowing the language. If that’s the case it should be undefined (which forces a rewrite) not chose a behavior that seems contrary to the documentation and common practice in this area. > On Jan 15, 2020, at 1:39 PM, Axel Wa

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread 'Axel Wagner' via golang-nuts
I don't think "clearly this behavior is not what you would want" is a valid generalization. type MyStruct{ // … } func (x *MyStruct) initialize() error { // does some common verification and populates some internal data structures return nil } func New() (*MyStruct, e

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread 'Axel Wagner' via golang-nuts
And, just as an addendum: IMO, if the result depends on the order of operations in a statement, prefer to rewrite it. Like, even if you are satisfied with the behavior you are seeing *and* you can rely on it - it should be clear by now that anyone looking at it will have to expand new effort unders

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Robert Engels
I think the way to look at it is “what would be the behavior of if you were inline creating and initializing a struct containing both values” - clearly this behavior is not what you would want or expect. > On Jan 15, 2020, at 1:25 PM, Paul Jolly wrote: > >  >> >> "when evaluating the opera

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Paul Jolly
> "when evaluating the operands of an expression, assignment, or return > statement, all function calls, method calls, and communication operations are > evaluated in lexical left-to-right order." My understanding goes as follows: the operands of the return statement are i and modify(&i). The

Re: [go-nuts] [ANN] github.com/perillo/workon command

2020-01-15 Thread Robert Engels
You might find visual studio code appealing for your Go development. > On Jan 15, 2020, at 11:58 AM, Manlio Perillo wrote: > >  > Hi. > > I have several relatively small personal projects. Every time I want to work > on them I need to launch a new terminal emulator and then open all the sou

[go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Tom Payne
The Go language specification on order of evaluation states: "when evaluating the operands of an expression, assignment, or return statement, all function calls, method calls, and communication operations are evaluated in lexical left-to-right

[go-nuts] [ANN] github.com/perillo/workon command

2020-01-15 Thread Manlio Perillo
Hi. I have several relatively small personal projects. Every time I want to work on them I need to launch a new terminal emulator and then open all the source files with an editor. Doing it N times starts to become annoying. For this reason I wrote the workon command. It will automatically sta

[go-nuts] No "official" documentation suggest to use annotated tags for releasing a new module version

2020-01-15 Thread Manlio Perillo
Today I release my first release of a module. Following https://blog.golang.org/publishing-go-modules, I create a non annotated tag. When I pushed the code to github I noticed that the tag was not sent to the remote repository. The option --follow-tags refuse to send not annotated tag. The only

[go-nuts] liteide x36.3 released

2020-01-15 Thread visualfc
Hi all, liteide x36.3 released! This version update gotools&gocode for support Go Module.  * LiteIDE Source code     https://github.com/visualfc/liteide * Release downloads     * https://github.com/visualfc/liteide/releases/latest     * https://sourceforge.net/projects/liteide/files     * [baidu

Re: [go-nuts] Getting from a string to an object value - how?

2020-01-15 Thread 'Vinay Sajip' via golang-nuts
On Tuesday, 14 January 2020 21:58:01 UTC, Ian Lance Taylor wrote: > In general this is not possible in Go. Sorry. > > If you can restrict yourself to exported package-scope variables, then > you can probably use the debug/pe (on Windows) package to look up the > symbol name and use that val

[go-nuts] Re: Is there a way to limit number or requests on a KeepAlive connection on net/http server?

2020-01-15 Thread hao dong
I don't think you can limit the number of requests by the *MaxRequestsPerConn* of fasthttp, because the Conn in this func is new struct created by fasthttp which stores in pool. Real client connections will be send to channels which be processed by these Conns. For @ Tamás , Server.ConnState ap

Re: [go-nuts] Getting a function's linked address?

2020-01-15 Thread Julio Guerra
For the record, I could do what I needed using the `//go:linkname` directive. My instrumentation tool injects statements that need features from another package that I cannot import. So I forward declare functions using a given link name that is implemented in another package - similarly to wha

[go-nuts] Re: How to make a server being server and client simultaneously

2020-01-15 Thread GopherNewbie
An exercise I am trying to do. -- 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. To view this discussion on the web visit

[go-nuts] Re: How to make a server being server and client simultaneously

2020-01-15 Thread Amnon Baron Cohen
Is this homework? > > -- 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. To view this discussion on the web visit https://