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

2021-04-08 Thread nikolay nikolay
If you CSV is simple, as in does not have multi-line values in columns, \n in line ending — then you can create your own wrapper around io.Reader that counts number of \n before returning to caller []bytes. -- Nikolay On Friday, April 9, 2021 at 1:50:10 AM UTC+8 peterGo wrote: > Dan, > > For G

Re: [go-nuts] Re: Releasing a V2 module and interacting with git branches

2021-04-08 Thread Robert Engels
Having a different v2 directory is a bad idea. It is not sustainable. It is a pain because you will have N copies of everything - so backporting bug fixes will be a pain. > On Apr 8, 2021, at 7:07 PM, Martin Atkins wrote: > > I had some experiences with doing this sort of thing for what even

[go-nuts] Re: Releasing a V2 module and interacting with git branches

2021-04-08 Thread Martin Atkins
I had some experiences with doing this sort of thing for what eventually became github.com/hashicorp/hcl/v2. I have some assorted notes to share about that experience, which I hope will substitute for a more definitive answer to your question "does this sound reasonable?", because I don't feel

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

2021-04-08 Thread Robert Solomon
I agree w/ your basic premise, that modules are quite painful. However, after much trials, tribulations, and posting here, I received the solution that allows me to structure my code as before (and like you, all in ~/go/src). I only had to edit the import strings to reflect "src/mypackage" in

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

2021-04-08 Thread Arya
For my work I need to make some modifications to an in-house raft library (https://raft.github.io/). Without delving too deep into the algorithm, one of the stages in the algorithm is a "candidate" goroutine that performs an assessment of whether it should be able to transition to a "leader" st

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

2021-04-08 Thread peterGo
Dan, For Go 1.17: encoding/csv: add the ability to get the line number of a record #44221 https://github.com/golang/go/issues/44221 Peter On Thursday, April 8, 2021 at 12:36:27 PM UTC-4 yodanj...@gmail.com wrote: > My need is similar to issue #26679 but not the same. > > I am using 1.15.8 > >

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

2021-04-08 Thread Dan Jackson
My need is similar to issue #26679 but not the same. I am using 1.15.8 I have a need for the "current line number" when reading a csv file (with Reader.Read() ) so that I can report errors in the data (not a csv parsing error but errors in the data in the csv file). In my case, a comment char

Re: [go-nuts] What is the easiest way to find out the source hosting url of a thrid-party dependency module/package?

2021-04-08 Thread tapi...@gmail.com
Ah. I forgot this way. Thanks for the tip! On Thursday, April 8, 2021 at 11:25:55 AM UTC-4 Jan Mercl wrote: > On Thu, Apr 8, 2021 at 5:18 PM tapi...@gmail.com > wrote: > > > It looks such info is not recorded in GOPATH/pkg/mod. > > Do you mean the import path to repository URL mapping? > > jnml

Re: [go-nuts] What is the easiest way to find out the source hosting url of a thrid-party dependency module/package?

2021-04-08 Thread Jan Mercl
On Thu, Apr 8, 2021 at 5:18 PM tapi...@gmail.com wrote: > It looks such info is not recorded in GOPATH/pkg/mod. Do you mean the import path to repository URL mapping? jnml@e5-1650:~/tmp$ wget modernc.org/sqlite && grep go- sqlite --2021-04-08 17:23:49-- http://modernc.org/sqlite Resolving mode

[go-nuts] What is the easiest way to find out the source hosting url of a thrid-party dependency module/package?

2021-04-08 Thread tapi...@gmail.com
It looks such info is not recorded in GOPATH/pkg/mod. -- 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 disc

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-08 Thread Khanh TN
Thanks. Looks like I need everything, including llc at LLVM11. I will stick with LLVM11. I assume gollvm will match with whatever LLVM version is current, like, update to match LLVM12 when LLVM12 is out? Khanh On Thursday, April 8, 2021 at 10:40:19 PM UTC+8 th...@google.com wrote: > >It outputs

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

2021-04-08 Thread Slawomir Pryczek
Thanks for the help, so i think i get it fully now. @Nick: Sure works great if you're making a project with github modules. Having local modules is possible. But so cumbersome people would be occupied with managing files rather than writing code (if you have >20 of them). @Carla: Actually i t

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-08 Thread 'Than McIntosh' via golang-nuts
>It outputs a hello.ll file. LLVM11 can process it but 10.0.1 and 13git cannot >Would love to hear your feedback. Maybe I need the exact LLVM version that gollvm is targeting? Yes, that is correct. The LLVM IR dump format (*.ll files) tends to change over time and from release to release, it isn't

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

2021-04-08 Thread Kevin Chadwick
> >>One solution is apparently to use a module like a giant mono repo, aka > >>gopath> Still it requires for this replace You do not need replace, unless you are amalgamating multiple modules. You can just create a folder named e.g. library with a .go file; package lib Then in your other folder

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-08 Thread Khanh TN
Hi, Thanks for your reply. It's a bit weird. I tried LLVM10.0.1 and the LLVM13 built from github along with gollvm, both did not work. However, I just tried LLVM11 and it worked. I haven't tried LLVM12. It looks like different LLVM version has different syntax? The Go code I tried is simplest:

Re: [go-nuts] Re: go mod vendor, description, how?

2021-04-08 Thread fgergo
On 4/6/21, Volker Dobler wrote: > Probably you are overthinking it. > ... Thank you all for your replies! I did overthink. When https://blog.golang.org/using-go-modules [part1-5] were published, I've read all of them, some parts several times. It helped with code migrations. Still my question re

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

2021-04-08 Thread 'Axel Wagner' via golang-nuts
On Thu, Apr 8, 2021 at 1:49 PM Nick Keets wrote: > In my case, we have an internal git server at work that we just access > over ssh. We have a few dependencies between repositories and a few > developers working on the same repository. I'm assuming this is a rare > scenario, but it is one use c

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

2021-04-08 Thread Nick Keets
On Thu, Apr 8, 2021 at 2:08 PM 'Carla Pfaff' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Thursday, 8 April 2021 at 12:48:28 UTC+2 nick@gmail.com wrote: > >> But what if you don't even have a domain for your source code? Sure you >> can use a fake domain like "foo.example" >> >

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

2021-04-08 Thread 'Carla Pfaff' via golang-nuts
On Thursday, 8 April 2021 at 12:48:28 UTC+2 nick@gmail.com wrote: > But what if you don't even have a domain for your source code? Sure you > can use a fake domain like "foo.example" > It doesn't have to be a fake domain name, just a module name, e.g. "foo". > and then use replace, and th

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-08 Thread 'Than McIntosh' via golang-nuts
Hi, Can you be a bit more specific, e.g. what Go code you compiler and what error you saw? It would also be helpful to know what version of lli/llc you were using. Thanks, Than On Thu, Apr 8, 2021 at 2:33 AM Khanh TN wrote: > Hi, > I'm following this page https://go.googlesource.com/gollvm to

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

2021-04-08 Thread Nick Keets
I think the problem is that this process is inconvenient, not that it is not possible. Modules work great if you publish everything on GitHub, or something similar. But what if you don't even have a domain for your source code? Sure you can use a fake domain like "foo.example" and then use replace