Re: [go-nuts] Re: A question about A sync.Once implementation.

2019-05-07 Thread Kurtis Rader
On Tue, May 7, 2019 at 9:42 PM White Pure wrote: > Hi, > Thanks for your reply. > The second bug is a known issue, so let’s ignore that. In that case, I > think function f still can only be executed once. > But why does the load and store of o.done need to be done using atomic >

[go-nuts] Re: A question about A sync.Once implementation.

2019-05-07 Thread White Pure
Hi, Thanks for your reply. The second bug is a known issue, so let’s ignore that. In that case, I think function f still can only be executed once. But why does the load and store of o.done need to be done using atomic operations? I suppose there’s mutex assuring the happens-before.

[go-nuts] Re: A question about A sync.Once implementation.

2019-05-07 Thread wudi . daniel
Hi, Thanks for your reply. The second bug is a known issue, so let’s ignore that. In that case, I think function f still can only be executed once. But why does the load and store of o.done need to be done using atomic operations? I suppose there’s mutex assuring the happens-before.

Re: [go-nuts] A question about A sync.Once implementation.

2019-05-07 Thread wudi . daniel
I'm quite sorry for that. This is my first time posting code here. Here's go playground link: https://play.golang.org/p/9xVjoD7rI0F. 在 2019年5月7日星期二 UTC+8下午10:08:39,Ian Lance Taylor写道: > > On Tue, May 7, 2019 at 5:55 AM > wrote: > > > > Hi, > > I did a quiz recently, but I'm having

Re: [go-nuts] Need help to make autocert working

2019-05-07 Thread Kurtis Rader
On Tue, May 7, 2019 at 8:39 PM Tong Sun wrote: > Thanks Kurtis, I'll for sure using it for some serious. > > For now, I need the program as minimalist as possible, because I'm trying > to rewrite this small Perl code as Go, > https://github.com/suntong/dbab/blob/master/src/bin/dbab-svr#L94 >

Re: [go-nuts] Need help to make autocert working

2019-05-07 Thread Tong Sun
On Tuesday, May 7, 2019 at 9:42:52 PM UTC-4, Kurtis Rader wrote: > > On Tue, May 7, 2019 at 6:07 PM Tong Sun > > wrote: > >> I've been trying to get an TLS server up and running for the past several >> days without success. I've used the following guides as reference: >> > > FWIW, I recommend

[go-nuts] How to detect source of a dependency in go.mod

2019-05-07 Thread tamal
I am trying to convert https://github.com/appscode/voyager from glide to go mod. I am getting an error like below: ``` go: github.com/Sirupsen/logrus@v1.4.1: parsing go.mod: unexpected module path "github.com/sirupsen/logrus" go: error loading module requirements ``` How do I find out the

Re: [go-nuts] Could someone tell me how to build gollvm?

2019-05-07 Thread Ting Yuan
Hello Than, when I using ninja to build gollvm, just like % cmake -DCMAKE_INSTALL_PREFIX=/home/yt/LLVMsvn/install - DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold -G "Ninja" ../llvm % ninja gollvm the build system still reports an error: ninja: error:

Re: [go-nuts] Need help to make autocert working

2019-05-07 Thread Kurtis Rader
On Tue, May 7, 2019 at 6:07 PM Tong Sun wrote: > I've been trying to get an TLS server up and running for the past several > days without success. I've used the following guides as reference: > FWIW, I recommend the Caddy HTTPS web server rather than rolling your own. It took me just a few

[go-nuts] Need help to make autocert working

2019-05-07 Thread Tong Sun
Hi, I've been trying to get an TLS server up and running for the past several days without success. I've used the following guides as reference: https://goenning.net/2017/11/08/free-and-automated-ssl-certificates-with-go/

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Marvin Renich
* Nitish Saboo [190507 14:07]: > Thanks Michel for your detailed response. > I am initialising the syslog engine. Do you mean "log/syslog" from the standard library? What does initialize do? > var obj1 parser = initalize() > var obj2 parser > go func() { > obj2 = initalize() > }() You have

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread JuciÊ Andrade
Now it is working. Thanks. -- 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 discussion on the web visit

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread thepudds1460
Hi Ian, I can now access golang-dev again via the web interface, whereas previously I could not. (Hopefully that is not a coincidence). Thanks for looking into this. Regards, thepudds On Tuesday, May 7, 2019 at 1:39:50 PM UTC-4, Ian Lance Taylor wrote: > > On Tue, May 7, 2019 at 8:01 AM

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Nitish Saboo
Thanks Michel for your detailed response. I am initialising the syslog engine. var obj1 parser = initalize() var obj2 parser go func() { obj2 = initalize() }() if obj1 engine fails: go func() { obj2.ReloadPattern(opts) }() My question is, will obj2.ReloadPattern reload the

Re: [go-nuts] What is the current status of generics in Go?

2019-05-07 Thread 'kalekold' via golang-nuts
Thanks. On Monday, 6 May 2019 21:55:19 UTC+1, Ian Lance Taylor wrote: > > On Mon, May 6, 2019 at 9:22 AM 'kalekold' via golang-nuts > > wrote: > > > > I saw a design document floating about sometime last year and there > seemed to be a lot of thought going into implementing them? What is the

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread Ian Lance Taylor
On Tue, May 7, 2019 at 8:01 AM Marcin Romaszewicz wrote: > > The same for me. golang-dev is not accessible to me, nor does it show up in a > group search, meaning it's not visible to me. I'm not a registered member of > it, so it appears to no longer be a public group. Thanks for all the

[go-nuts] Re: the Dominance of English in Programming Languages

2019-05-07 Thread skinner . david
When I first used IBM's UniComal the manual was Danish but the keywords were English. Sometimes the function names in the examples were Danish. I un derstand your problem. However, I do think that language is irrellevent. The keywords are tokens that can be replaced programmatically with SED

Re: [go-nuts] Re: Trouble running exec.Command() as a different unix user.

2019-05-07 Thread worc0260 via golang-nuts
On Friday, March 27, 2015 at 8:48:30 PM UTC+1, James Bardin wrote: > > > On Fri, Mar 27, 2015 at 3:38 PM, AJ B > wrote: > >> So I just ran it as root and it worked. Thanks for the help. But why >> wouldn't my default user be able to run a command as itself using a binary >> it obviously has

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread JuciÊ Andrade
My IP: 177.223.105.20 Tried both Microsoft Edge and Mozilla Firefox Developer Edition version 67.0b17 (64-bits) No problem at all accessing golang-nuts. On 5/7/19, Marcin Romaszewicz wrote: > The same for me. golang-dev is not accessible to me, nor does it show up in > a group search, meaning

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread Marcin Romaszewicz
The same for me. golang-dev is not accessible to me, nor does it show up in a group search, meaning it's not visible to me. I'm not a registered member of it, so it appears to no longer be a public group. -- Marcin On Tue, May 7, 2019 at 7:57 AM wrote: > Sorry, forgot to include: Yes, I can

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread howardcshaw
Sorry, forgot to include: Yes, I can access golang-nuts, no errors. Golang-announce works fine, neovim gives the error. Clojure works fine. Howard -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread howardcshaw
I get the error online as well, using groups.google.com/forum/#!golang-dev Refreshing the page has no effect. Incognito mode, not logged in, gives the same error. Google Chrome 74.0.3729.131 (Official Build) (64-bit) (cohort: Stable) IP is in the 104.182.104.255 block. Firefox Version 67.0b12

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread Ian Lance Taylor
On Tue, May 7, 2019 at 7:22 AM JuciÊ Andrade wrote: > > Me too. I can't access golang-dev. > "An error (#401) occurred while communicating with the server." OK, if people are comfortable with it, it would help to know browser version and IP address and whether you can access other groups such as

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread JuciÊ Andrade
Me too. I can't access golang-dev. "An error (#401) occurred while communicating with the server." > > -- 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

Re: [go-nuts] Re: How to run a go method on multiple cores ?

2019-05-07 Thread Michael Jones
Perhaps you will find this blog post (and the related ones before and after) and the videos linked at the bottom to be faster. https://blog.golang.org/pipelines On Tue, May 7, 2019 at 6:22 AM wrote: > Can anyone recommend a good on-line doc for goroutines ? The best one I've > found so far

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-05-07 Thread DrGo
I suggest that we first solve less controversial issues like the Israeli–Palestinian conflict. -- 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

Re: [go-nuts] A question about A sync.Once implementation.

2019-05-07 Thread Ian Lance Taylor
On Tue, May 7, 2019 at 5:55 AM wrote: > > Hi, > I did a quiz recently, but I'm having problem with the answer. > Quiz: https://github.com/smallnest/go-concurrent-quiz#-quiz-4 When sending code, please just send plain text or a link to play.golang.org. Thanks. I can't actually

Re: [go-nuts] Could someone tell me how to build gollvm?

2019-05-07 Thread 'Than McIntosh' via golang-nuts
Hello, For the gollvm build ninja is recommended (using "make" is untested and I doubt if it will work). Thanks, Than On Tue, May 7, 2019 at 9:27 AM wrote: > I try to build gollvm on ubuntu(x64) following these commands in > https://go.googlesource.com/gollvm/ : > > % cd workarea > % mkdir

Re: [go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread Ian Lance Taylor
On Tue, May 7, 2019 at 4:05 AM peterGo wrote: > > Liam, > > "Web access to golang-dev is down" is too vague. Please be more precise. For > example, my recent experience: > > For the past few days, browsing to golang-dev without logging on, I get an > error: > >

Re: [go-nuts] Re: How to run a go method on multiple cores ?

2019-05-07 Thread Michel Levieux
https://golang.org/ref/spec#Go_statements Small but clear IMO. That said, for the everyday-use of goroutines, there's not much to know about them. If you really want / need to go deep into the way goroutines work, there are articles written by people on the web (

[go-nuts] Could someone tell me how to build gollvm?

2019-05-07 Thread yuanting
I try to build gollvm on ubuntu(x64) following these commands in https://go.googlesource.com/gollvm/ : % cd workarea % mkdir build-debug % cd build-debug % cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold ../llvm ... % make gollvm -j4 ... % but I got -- Targeting X86 -- starting libgo

[go-nuts] Re: How to run a go method on multiple cores ?

2019-05-07 Thread lgodio2
Can anyone recommend a good on-line doc for goroutines ? The best one I've found so far uses a very SLOW approach to present essential info https://gobyexample.com/goroutines On Monday, May 6, 2019 at 7:11:00 AM UTC-4, Nitish Saboo wrote: > > Hi, > > I want a go method to run on multiple

[go-nuts] Re: Simple Go web server that service files

2019-05-07 Thread suntong001
On Tuesday, May 7, 2019 at 7:40:19 AM UTC-4, Luis Furquim wrote: > > Hi > > I think that this is the case that "proper way" means "the one that fits > your needs". > Ah, yeah, that's true -- I thought that there are some canonical ways, but you are indeed right. -- You received this

[go-nuts] A question about A sync.Once implementation.

2019-05-07 Thread wu . purewhite
Hi, I did a quiz recently, but I'm having problem with the answer. Quiz: https://github.com/smallnest/go-concurrent-quiz#-quiz-4 package doublecheck import ( "sync" ) type Once struct { msync.Mutex done uint32 } func (o *Once) Do(f func())

[go-nuts] Re: Simple Go web server that service files

2019-05-07 Thread Luis Furquim
Hi I think that this is the case that "proper way" means "the one that fits your needs". Some solutions you may adopt: a) (cd /path/to/my/server/directory ; go run main.go) & b) use absolute pathnames: os.Open("/path/to/my/server/directory/ images/my.png") c) Load configuration from some file/db

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Michel Levieux
If the only thing you want to achieve is: main: run engineA run engineB engineA: do something if engineB is down -> run engineB engineB: do something if engineA is down -> run engineA You don't really need the two processes to run on different cores, nor do you need them to be constantly

[go-nuts] Re: Web access to golang-dev is down

2019-05-07 Thread peterGo
Liam, "Web access to golang-dev is down" is too vague. Please be more precise. For example, my recent experience: For the past few days, browsing to golang-dev without logging on, I get an error: https://groups.google.com/forum/#!forum/golang-dev An error (#401) occurred while communicating

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Nitish Saboo
Hi Jan, I need two separate parsing engines to be running and I feel that is possible when it is running parallel on two different cores. If operation on one of the parsing engine fails, I will reload the other parsing engine and do the operation.This is what I want to achieve. I thought

[go-nuts] Re: the Dominance of English in Programming Languages

2019-05-07 Thread Mirko Friedenhagen
Well, back in the 90s the Microsoft Office Basic dialects were internationalized so you could write something like "Für Alle Zellen In DieseArbeitsMappe.ArbeitsBlätter[5]" instead of "for all cells in ThisWorkmap.WorkSheets[5]". But you could open/run this only with a German version of Excel

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Jan Mercl
On Tue, May 7, 2019 at 11:27 AM Nitish Saboo wrote: > I want to initialise parsing engines on two different processors. Are goroutines meant where we read 'processors'? If not, than this maybe is an XY problem[0] and please explain why you need distinct CPUs to execute the code. [0]:

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Nitish Saboo
Hi Michel, I want to initialise parsing engines on two different processors.This I am achieving in the following manner: var obj1 parser = initalize() var obj2 parser go func() { obj2 = initalize() }() Post this I want to reload the engine of obj2 parser, which I am trying to achieve using the

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-07 Thread Michel Levieux
I don't know of any primitives that would return the current processor the goroutine is currently running on. Maybe if you explain more precisely what you are trying to do, we can find a better solution? @lgodio2 no, as Jan said, the go statement is not an expression, so you can't assign with it,