Re: [go-nuts] goimports performance degrades in go module

2018-11-10 Thread Todd Neal
I tracked this down (at least it was the source of a slow goimports for me) and put up a CL at https://go-review.googlesource.com/c/tools/+/132598/ .The issue was that it's eventually exec'ing the go command for every import in the presence of modules, which adds up quickly and also doesn't eas

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Paul Jolly
> Maybe it's just me (and projects like the Stripe SDK and Blackfriday), but > that's exactly what I would expect. Have you raised an issue/experience report with this feedback? > Building source files is subject to build constraints, generating a go.mod > isn't (or shouldn't be; unless there's

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Sam Whited
On Sat, Nov 10, 2018, at 11:00, Paul Jolly wrote: > > I've just seen several projects do this wrong because they don't know about > > go mod tidy so they build, let CI run tests (and don't notice that the file > > has changed in CI), and call it a day never knowing that they're missing > > depen

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Paul Jolly
> I've just seen several projects do this wrong because they don't know about > go mod tidy so they build, let CI run tests (and don't notice that the file > has changed in CI), and call it a day never knowing that they're missing > dependencies. Since I can't imagine why you'd want to have part

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Sam Whited
On Sat, Nov 10, 2018, at 10:39, Paul Jolly wrote: > I don't think there's anything wrong with this distinction - when you > say "unless this has been fixed", are you suggesting the behaviour is > wrong or could be improved in some respect? I've just seen several projects do this wrong because they

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Paul Jolly
> > It does in as much as adding missing dependencies are concerned, but > > doesn't do the tidying (removal) in go.{mod,sum} that go mod tidy > > does. > > I don't think this is true (unless this has been fixed, I can't upgrade to > check right this moment), go build respects build constraints (e

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Sam Whited
On Sat, Nov 10, 2018, at 09:46, Paul Jolly wrote: > > 2. "Why doesn't "go build" run "go mod tidy" automatically? > > It does in as much as adding missing dependencies are concerned, but > doesn't do the tidying (removal) in go.{mod,sum} that go mod tidy > does. I don't think this is true (unless

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread T L
On Saturday, November 10, 2018 at 11:47:19 AM UTC-4, Paul Jolly wrote: > > > 1. Why does "go build" still connect to go101.org even if the wording " > go101.org" doesn't appear in any source code and go.mod files? > > That has been fixed in the CL associated with > https://github.com/golang/go/

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-11-10 Thread Fino
Flutter comes out, and using Dart... Gophers should all working hard, to make Go occupy more domain area, besides docker, k8s and blockchain. I think GUI/Game Engine and BigData/Spark(by scala) are 2 domain Gophers should try to walk in. BR fino > It would be nice if cross-platform GUIs wer

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Paul Jolly
> 1. Why does "go build" still connect to go101.org even if the wording > "go101.org" doesn't appear in any source code and go.mod files? That has been fixed in the CL associated with https://github.com/golang/go/issues/27859, available on tip. > 2. "Why doesn't "go build" run "go mod tidy" auto

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread T L
On Saturday, November 10, 2018 at 9:47:13 AM UTC-4, T L wrote: > > After adding the require line and run "go mod tidy", the program compiles > successfully. > Thanks for your help! > > But I still have some confusions. > 1. Why does "go build" still connect to go101.org even if the wording " > g

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread T L
After adding the require line and run "go mod tidy", the program compiles successfully. Thanks for your help! But I still have some confusions. 1. Why does "go build" still connect to go101.org even if the wording "go101.org" doesn't appear in any source code and go.mod files? 2. "Why doesn't "g

[go-nuts] Re: goimports performance degrades in go module

2018-11-10 Thread wilk
On 08-11-2018, 'Ian Cottrell' via golang-nuts wrote: > --ea8501057a283d99 > Content-Type: text/plain; charset="UTF-8" > > Hi, > > Could you try the module aware fork of goimports > https://github.com/heschik/goimports and let us know if it works and > is > acceptable speed wise? > We a

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Paul Jolly
> But the go101.org is not intended to serve any code repository. > This is why I use the replace line in go.mod. If go101.org will never resolve the custom import path (giving meta information, as indicated at https://golang.org/cmd/go/#hdr-Remote_import_paths), then why make this the module path

[go-nuts] Re: what does the "replace" in go.mod mean?

2018-11-10 Thread T L
It is more strange that, if I replace the go101.org appearances with "aaa.bbb", a non-existing domain. // main.go package main import ( _ "aaa.bbb/tinyrouter" ) func main() { } // go.mod module app replace aaa.bbb/tinyrouter => github.com/go101/tinyrouter v1.0.0 then run "go build -x -v

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread T L
On Saturday, November 10, 2018 at 5:20:15 AM UTC-4, Shulhan wrote: > > On Sat, 10 Nov 2018 00:54:50 -0800 (PST) > T L > wrote: > > > > > $ go build -v -x > > WORK=/tmp/go-build304435862 > > Fetching https://go101.org/tinyrouter?go-get=1 > > Parsing meta tags from https://go101.org/tinyroute

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Shulhan
On Sat, 10 Nov 2018 00:54:50 -0800 (PST) T L wrote: > > $ go build -v -x > WORK=/tmp/go-build304435862 > Fetching https://go101.org/tinyrouter?go-get=1 > Parsing meta tags from https://go101.org/tinyrouter?go-get=1 (status > code 404) Are you familiar with "Remote import path"? [1] If the im

[go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread T L
I host a package on github: https://github.com/go101/tinyrouter And I decided to use "go101.org/tinyrouter" as its import path. Then in a program which import the package: // main.go package main import ( _ "go101.org/tinyrouter" ) func main() { } // go.mod module app replace go101.org/ti

Re: [go-nuts] goimports performance degrades in go module

2018-11-10 Thread roger peppe
I will add that I regularly see goimports with modules take many seconds to run. I'm using acmego and I sometimes end up needing to switch that off because it corrupts text seconds after a save. On Fri, 9 Nov 2018, 3:26 pm Joseph Lorenzini Hi Ian/Russ, > > I should have clarified that I was doing