[go-nuts] Re: GO Mod (modules) for dummies. Please help.

2019-10-24 Thread Volker Dobler
Hi I think one of the main struggles stems from "dependency" having two technical meanings: a) If a package a imports a package b then a depends on b. This is a priori agnostic to versions. This type of dependency is expressed by a simple import "import/path/of/b" in a's source

[go-nuts] errors custom As

2019-10-24 Thread Gert
Hi, I fail to understand how the custom As is suppose to work? see example https://play.golang.org/p/tjuItX5dHoJ -- 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

[go-nuts] why time.Time.Format() so slow when first called?

2019-10-24 Thread 陈清和
here is the code: ```go func main() { for i := 0; i < 10; i++ { start := time.Now() time.Now().Format("20060102150405") end := time.Now() fmt.Println(end.Sub(start)) } } // output: 34.9788ms 0s 0s 0s 0s 0s 0s 0s 0s 0s ``` here are my questions: 1. why Format so slow? 2. why Format() become

[go-nuts] Re: Roadblock for user-implemented JIT compiler

2019-10-24 Thread Gert
This kind of low level is way out of my league but what about using https://github.com/tinygo-org/tinygo instead to build your JIT? I only know tinygo has no garbage collector at all. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: Roadblock for user-implemented JIT compiler

2019-10-24 Thread Kevin Chadwick
On 2019-10-24 09:50, Gert wrote: > This kind of low level is way out of my league but what about > using https://github.com/tinygo-org/tinygo instead to build your JIT? I only > know tinygo has no garbage collector at all. Don't let this stop you getting things done but I would hope that any

[go-nuts] Re: Struggling with go mod, micro-repos and private forks

2019-10-24 Thread Shaun Crampton
> > > The good news is that we're aware of (and planning to address) most of > these pain points; the bad news is that we haven't been able to get to most > of them yet. > > Great to see, thanks! > >> I think the biggest problem we have is when working with private repos. >> What I want

[go-nuts] Re: errors custom As

2019-10-24 Thread Jake Montgomery
I have not done much with the new errors stuff, but I'll try to help. I assume you have read https://github.com/golang/go/wiki/ErrorValueFAQ and https://blog.golang.org/go1.13-errors. There may be other posts as well. These new error functions, Is() and As() are about error types. It looks

[go-nuts] Re: Struggling with go mod, micro-repos and private forks

2019-10-24 Thread Shaun Crampton
I circed some of the suggestions round my team. Sounds like others had already tried some of the suggestions with mixed results: - Go v1.13 still has trouble authenticating to github without an "insteadof" in the config. We use 2FA on github, which seems to make HTTPS fail in a way

[go-nuts] Re: JSON encoder does not use custom TextMarshaler for map keys when the map key type is a custom string type

2019-10-24 Thread Jake Montgomery
Just a friendly reminder. When sending code to this list, please use a link to the Go playground or use plain text. The colored text with a black background is unreadable. Thanks. On Wednesday, October 23, 2019 at 11:45:24 PM UTC-4, Barakat Barakat wrote: > > I'm using macOS Mojave, go 1.12.4

[go-nuts] Re: main() cannot call method in another file

2019-10-24 Thread Chris Hines
go run works now too and pulls in all the files in the package at so "go run ." is a nice shortcut that works more like the other subcommands of the go tool. On Thursday, October 24, 2019 at 8:17:54 AM UTC-4, Guy Allard wrote: > > Use: > > go run *.go > > or > > go build *.go > > > On

[go-nuts] Re: main() cannot call method in another file

2019-10-24 Thread Guy Allard
Use: go run *.go or go build *.go On Wednesday, October 23, 2019 at 1:20:26 AM UTC-4, Cam wrote: > > Hi everyone on Golang group, > > I'm having difficulty with some simple code, and appreciate if someone can > point out a solution. > > There is a simple main package that looks like this: >

Re: [go-nuts] Re: Struggling with go mod, micro-repos and private forks

2019-10-24 Thread 'Bryan C. Mills' via golang-nuts
On Thu, Oct 24, 2019 at 5:36 AM Shaun Crampton wrote: > I think the biggest problem we have is when working with private repos. >>> What I want to express to the tool is >>> >>> My module requires commit abcd1234 (or version v1.2.3) of dependency >>> x/y/z >>> >>> Look for any instances of

[go-nuts] Re: main() cannot call method in another file

2019-10-24 Thread Cam
Your suggestions helped me build the files with the same project structure: // From folder username/ go build playground/*.go // From folder playground/ go build *.go go build . Thanks !! On Tuesday, October 22, 2019 at 10:20:26 PM UTC-7, Cam wrote: > > Hi everyone on Golang group, > > I'm

Re: [go-nuts] Re: Struggling with go mod, micro-repos and private forks

2019-10-24 Thread 'Bryan C. Mills' via golang-nuts
On Thu, Oct 24, 2019 at 1:07 PM Shaun Crampton wrote: > I circed some of the suggestions round my team. Sounds like others had > already tried some of the suggestions with mixed results: > > >- Go v1.13 still has trouble authenticating to github without an >"insteadof" in the config.

[go-nuts] Re: errors custom As

2019-10-24 Thread Gert
Thx, examples helped allot in understanding On Thursday, October 24, 2019 at 6:53:32 PM UTC+2, Jake Montgomery wrote: > > I have not done much with the new errors stuff, but I'll try to help. > > I assume you have read https://github.com/golang/go/wiki/ErrorValueFAQ > and

Re: [go-nuts] why time.Time.Format() so slow when first called?

2019-10-24 Thread Ian Lance Taylor
On Thu, Oct 24, 2019 at 2:11 AM 陈清和 wrote: > > here is the code: > > ```go > func main() { > for i := 0; i < 10; i++ { > start := time.Now() > time.Now().Format("20060102150405") > end := time.Now() > fmt.Println(end.Sub(start)) > } > } > > // output: > > 34.9788ms > 0s > 0s > 0s > 0s > 0s > 0s >