Re: [go-nuts] Packages vs methods

2023-04-04 Thread
If one is using gopls for Go support for an IDE (like vscode), with semantic tokens enabled, the two cases are colored differently. It's incrementally cheap, as gopls already typechecks source. [to enable in vscode: in settings, in the gopls section, "ui.semanticTokens": true] I don't know that

Re: [go-nuts] A goroutine question

2021-02-19 Thread
A 100-long vector is way too short to show any benefit. goroutines have start-up, scheduling, and shut-down costs. What happens if you try to square the largest matrix you can fit into memory (10,000 by 1?) On Fri, Feb 19, 2021 at 9:46 AM Yuwen Dai wrote: > Hi experts, > > I'm a newbie to

Re: [go-nuts] What is The compiler's -json optimization logging

2020-09-04 Thread
And gopls will compute them as diagnostics. For instance, if using vscode and gopls, then in setting.json: "gopls": { "codelens": { "gc_details": true, } } and a clickable 'Toggle gc annotation details' should appear just above the package statement. On Fri, Sep 4, 2020 at 4:28 PM Ian

Re: [go-nuts] Re: keep just 2 decimal places in a float64

2020-01-26 Thread
And from Wikipedia on the Vancouver Stock Exchange. "The history of the exchange's index provides a standard case example of large errors arising from seemingly innocuous floating point calculations. In January 1982 the index was initialized at 1000

Re: [go-nuts] Get tmp stuff in $GOTMPDIR instead of /tmp?

2019-08-23 Thread
This is routinely happening to me too, on linux. My go commands are go build *.go The left-over directories are empty I'm on go1.12.5 linux/amd64 On Fri, Aug 23, 2019 at 10:04 AM Ian Lance Taylor wrote: > On Thu, Aug 22, 2019 at 7:55 AM wrote: > > > > I get a bloated /tmp-dir (in just a few

Re: [go-nuts] Generating LSP protocol Go types

2019-07-13 Thread
I'm responsible for some of that code but other than that, I'm just giving my personal opinion. There's no fundamental reason it couldn't be public, but, 1. They change all the time (weekly for some of it, more slowly for tsprotocol.go, which follows the Microsoft code) 2. They are adapted to the

Re: [go-nuts] Go Language Survey

2019-06-12 Thread
I agree that ? for simple choices is nice. But my C experience with nested ?s and with long expressions for one or both branches has not been nice. The mandatory {}s make Go's nested ifs more readable (but vertical). On Wed, Jun 12, 2019 at 2:42 PM Michael Jones wrote: > Roger, here's the same

Re: [go-nuts] Re: adding context.Context to new code

2017-05-14 Thread
heck for nil and will panic. > > On Sun, May 14, 2017 at 11:43 AM Sameer Ajmani <sam...@golang.org> wrote: > >> Generally I'd suggest passing context.Background() when calling functions >> that need a context from main or tests. >> On Sat, May 13, 2017 at 8:27 AM Pete

Re: [go-nuts] Re: adding context.Context to new code

2017-05-13 Thread
Hi. I was one of the people who failed in an attempt to auto-insert contexts in all of google3. I no longer remember all the obstacles I failed to overcome, but would encourage others to take on the project. One issue was libraries that were used both in paths from http requests (so they needed