Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-09 Thread Michael Ellis
FWIW, I completely agree with the sentiment that confusing documentation has created pain and unnecessary difficulty for solo developers. I try to keep in mind that Go was developed for use by large teams working on million line programs and that I'm lucky to be able to piggyback on the effort

Re: [go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread Justin Israel
On Sat, Apr 10, 2021 at 3:38 AM 'gonutz' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Justin Isreael said > > "Changes to ProjectB should be immediately available when compiling > ProjectA." > > which is not true when you simply insert a replace in your go.mod file. > > My current prob

Re: [go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread roger peppe
On Fri, 9 Apr 2021, 16:37 'gonutz' via golang-nuts, < golang-nuts@googlegroups.com> wrote: > Justin Isreael said > > "Changes to ProjectB should be immediately available when compiling > ProjectA." > > which is not true when you simply insert a replace in your go.mod file. > > My current problem i

Re: [go-nuts] go text://protocol client?

2021-04-09 Thread 'Dan Kortschak' via golang-nuts
On Fri, 2021-04-09 at 17:01 +0200, 'Petite Abeille' via golang-nuts wrote: > [1] https://textprotocol.org That's an extraordinarily and unnecessarily obtuse document. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-09 Thread Wojciech S. Czarnecki
Dnia 2021-04-07, o godz. 14:31:07 Slawomir Pryczek napisał(a): > Anyone has an idea for a reasonable solution which will allow easy > refactoring and code organization in packages, in this new model? Idea is here: https://github.com/golang/go/issues/44347 Whether is it reasonable or not — obje

Re: [go-nuts] Designing a recurring event with timeouts using channels

2021-04-09 Thread Arya
This was very helpful. I was somewhat apprehensive about using channels for this since I noticed a few other raft implementations have leveraged "shared-memory" instead of message passing to model the protocol. Validation of my approach really helps with making progress on this front. It didn't

Re: [go-nuts] go text://protocol client?

2021-04-09 Thread Jesper Louis Andersen
On Fri, Apr 9, 2021 at 5:37 PM 'Petite Abeille' via golang-nuts < golang-nuts@googlegroups.com> wrote: > > Would you know of any go text://protocol clients? Or servers? > > No, but it would be a fairly good beginner project[0] [0] Readers of the erlang-questions@ mailing list would know :P -- Y

Re: [go-nuts] How can I compile go plan9 asm to object file with ELF format

2021-04-09 Thread Ian Lance Taylor
On Fri, Apr 9, 2021 at 6:00 AM JX Zhang wrote: > > Asm in go is in style of plan9. Now I need to compile the asm files into a .o > file which is an ELF object > In original go tool chains, go use go/pkg/tool/linux_amd64/asm to compile asm > to a `go object` file instead of ELF object I don't th

Re: [go-nuts] Re: text/template: Can't call method/function with 0 results.

2021-04-09 Thread 'Johnny Jacobs' via golang-nuts
I'm mostly thinking of functions with side-effects, much like {{ $var := "val" }}. It doesn't make much sense for these to return anything. Not allowing 0-valued functions limits functions you can call on objects in templates as well. For example, a trivial map implementation: type MyMap map[strin

Re: [go-nuts] Why does my code keep giving me "socket: too many open files"

2021-04-09 Thread Jeff Peck
On 4/9/21 11:57 AM, Tenjin wrote: Basically I am making a script to query an api for some json data, if I run it synchronously it works fine and works as intended but it needs to do this give or take 15thousand times so I thought I would use concurrency to get the job done. It works fine for a

[go-nuts] Re: Go module dependency debugging workflow

2021-04-09 Thread 'gonutz' via golang-nuts
Oh thanks a lot Carla Pfaff! I did not even know a v0.0.0-unpublished pseudo-version existed. It is not mentioned in the Go Modules Reference https://golang.org/ref/mod for whatever reason. This really takes the edge off. I was also pointed at the replace by some people on StackOverflow and whi

[go-nuts] Re: text/template: Can't call method/function with 0 results.

2021-04-09 Thread aind...@gmail.com
I believe functions are meant to be used as part of a pipeline, so having 1 value (+ error) makes it so the pipeline only stops execution on an error. I personally have not found a use for void functions, and it makes it easier to visualize the template execution model. On Friday, April 9, 2021 at

Re: [go-nuts] text/template: Can't call method/function with 0 results.

2021-04-09 Thread 'Thomas Bushnell BSG' via golang-nuts
I find the current behavior clearer. What would you like a no-valued function to insert in the template? Even if it was the zero value, that could be the string-typed zero value, or the int-typed zero value, and so forth. It could be defined, but why not make it explicit if you want it to insert n

[go-nuts] Re: Should sync.Locker for sync.Once

2021-04-09 Thread aind...@gmail.com
Argh I messed up the title. It should be "Should sync.Once implement sync.Locker?" Oh well... On Friday, April 9, 2021 at 2:07:00 PM UTC-4 aind...@gmail.com wrote: > I've often been in situations where I've wanted to store and error or some > other signal once, but wanted reads to the stored va

[go-nuts] Should sync.Locker for sync.Once

2021-04-09 Thread aind...@gmail.com
I've often been in situations where I've wanted to store and error or some other signal once, but wanted reads to the stored value to be synchronized. I've often ended up introducing a secondary mutex, or reimplementing the slow path of sync.Once. This is a common pattern I see across many Go c

[go-nuts] text/template: Can't call method/function with 0 results.

2021-04-09 Thread 'Johnny Jacobs' via golang-nuts
Hello all, Is there any reason you can't use a custom function with no return value in Go templates? You get a "Can't call method/function with 0 results." if you try to call such a function. FuncMap requires functions to either return a value,

Re: [go-nuts] Why does my code keep giving me "socket: too many open files"

2021-04-09 Thread Jesper Louis Andersen
On Fri, Apr 9, 2021 at 7:20 PM Tenjin wrote: > Basically I am making a script to query an api for some json data, if I > run it synchronously it works fine and works as intended but it needs to do > this give or take 15thousand times so I thought I would use concurrency to > get the job done. It

[go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread Volker Dobler
On Friday, 9 April 2021 at 17:38:12 UTC+2 gonutz wrote: > A replace in the go.mod file is of no help here because I still have to > specify a require with a concrete version or commit hash for the library. > Why do you think so? Replace with your local filesystem path of the library requires n

[go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread oldCoderException
I certainly agree with everyone who has been saying that implementing modules can be painful. Implementing them was initially a multi-week nightmare of sleepless nights for me, and I still sometimes shake my head with their use. I think that a large part of the problem is that the documentati

[go-nuts] Why does my code keep giving me "socket: too many open files"

2021-04-09 Thread Tenjin
Basically I am making a script to query an api for some json data, if I run it synchronously it works fine and works as intended but it needs to do this give or take 15thousand times so I thought I would use concurrency to get the job done. It works fine for about 4 thousand queries then it stop

[go-nuts] Re: Go module dependency debugging workflow

2021-04-09 Thread 'Carla Pfaff' via golang-nuts
On Friday, 9 April 2021 at 17:38:12 UTC+2 gonutz wrote: > I could create a local commit to the library or create a new debug branch > in my local copy of the library. Then I insert my debug code and commit it. > Then I point my main program's go.mod file at the new commit/branch, adding > a rep

[go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread 'Carla Pfaff' via golang-nuts
On Friday, 9 April 2021 at 17:38:12 UTC+2 gonutz wrote: > A replace in the go.mod file is of no help here because I still have to > specify a require with a concrete version or commit hash for the library. > This means I cannot just change the code in the library module, I also have > to create

[go-nuts] Re: encoding/csv: getting a line number of current record when using csv.Reader

2021-04-09 Thread Tamás Gulácsi
And if your CSV is not so simple, then extract the number of "\n"-s found in the fields from the line count gathered by counting "\n"-s. Or re-encode the csv into a "\n" counting io.Writer. nikolay nikolay a következőt írta (2021. április 9., péntek, 7:03:49 UTC+2): > If you CSV is simple, as i

[go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread 'gonutz' via golang-nuts
Justin Isreael said "Changes to ProjectB should be immediately available when compiling ProjectA." which is not true when you simply insert a replace in your go.mod file. My current problem is that I have a main module that uses a library module. I want to debug an issue so I insert a print st

[go-nuts] Golang security advisories

2021-04-09 Thread Hritik Vijay
Hello In golang-announce list all security update related mails are tagged as "[security]". Is there a portal where they are stored in a more structural way ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

[go-nuts] go text://protocol client?

2021-04-09 Thread 'Petite Abeille' via golang-nuts
Hello, Would you know of any go text://protocol clients? Or servers? Thanks in advance. [1] https://textprotocol.org [2] https://github.com/textprotocol/public [3] https://github.com/textprotocol/publictext -- You received this message because you are subscribed to the Google Groups "golang-n

[go-nuts] Go module dependency debugging workflow

2021-04-09 Thread 'gonutz' via golang-nuts
I was referred here from my closed Github issue ( https://github.com/golang/go/issues/45467 ). I have a practical question about debugging in the world of Go modules. The scenario: I am creating module mp3player, my main program. It uses library module mp3. While debugging I insert print statem

Re: [go-nuts] package is not in GOROOT

2021-04-09 Thread rob
Thanks. If only the docs would make that clear. My experience with reading them is: clear only if previously known. Much frustration about modules could have been avoided by more clearly written documentation So it goes -- rob drrob...@fastmail.com On Fri, Apr 9, 2021, at 11:

Re: [go-nuts] package is not in GOROOT

2021-04-09 Thread 'wagner riffel' via golang-nuts
On Wed, 7 Apr 2021 20:11:22 -0400 rob wrote: > Would it be a bad idea to use my ~go/src as a module? > I don't think so, I do have one global module like this for my own toys and throwaways programs. Yes, it would need to adjust your import paths according to the module, when I migrated to modu

Re: [go-nuts] Designing a recurring event with timeouts using channels

2021-04-09 Thread Jesper Louis Andersen
On Thu, Apr 8, 2021 at 8:15 PM Arya wrote: > There are a few things that I am worried about in the above given snippet. > The first thing is whether I am in alignment with golang's idioms while > modeling this process using channels and the second thing is where I am > resetting the voteStatusCha

[go-nuts] How can I compile go plan9 asm to object file with ELF format

2021-04-09 Thread JX Zhang
Asm in go is in style of plan9. Now I need to compile the asm files into a .o file which is an ELF object In original go tool chains, go use go/pkg/tool/linux_amd64/asm to compile asm to a `go object` file instead of ELF object -- You received this message because you are subscribed to the Goo

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2021-04-09 Thread JX Zhang
Go does can define functions in a plan9 style assembly file. I have a question about how to compile a plan9 style asm file to an ELF .o object? 在2020年10月20日星期二 UTC+8 上午1:12:45 写道: > Have a look at https://golang.org/doc/asm > and examples are always a good source of inspiration. For example > h