[go-nuts] How to renderer the multiple html pages ?

2019-02-02 Thread Robert Hsiung
Hi all: I make three html pages as index.html ,wps1.html and wps2.html. The three html pages are under the same folder. The expected flow is to login index.html first and access wps1 or wps2 by index page hyperlink. And then,I edit the golang source file and build exe file . But I launch

Re: [go-nuts] lock for assigning to different elements of an array

2019-02-02 Thread robert engels
Actually, in the comments on that paper it states : A technical note: C++11 essentially prohibits compilers from introducing stores that were not written by the programmer. See 1.10 paragraph 22 of the C++ standard. Previous versions of the standard did permit such an irksome possibility. I as

Re: [go-nuts] Re: lock for assigning to different elements of an array

2019-02-02 Thread robert engels
No, you are not even using the mutex in that code... > On Feb 2, 2019, at 4:43 AM, xue...@gmail.com wrote: > > I think you can change it like below: > > var rm sync.Mutex > var ts [2]string > for i, s := range []string{"first", "second"} { > i, s := i, s > go func(i int, s string){

Re: [go-nuts] lock for assigning to different elements of an array

2019-02-02 Thread robert engels
I am not sure those critical failures outlined in the paper are possible in Go, certainly not Java, but I’d like to understand more. I don’t think the ‘re-using of the memory’ can happen, since it is a local variable, and to be seen by another thread it would be captured in a closure and be pro

[go-nuts] Re: lock for assigning to different elements of an array

2019-02-02 Thread xuejoy
I think you can change it like below: > var rm sync.Mutex > var ts [2]stringfor i, s := range []string{"first", "second"} { i, s := > i, sgo func(i int, s string){ ts[i] = s }(i,s)} > > > -- You received this message because you are subscribed to the Google Group

[go-nuts] url.parse issue if the first character of a url is a number

2019-02-02 Thread xuejoy
If a url frist character is a number like 5abc.cnd.com:443, it will throws an error during url.parse() I checked the url.go source code, and I noticed the root cause is the below code( method getschema()): case '0' <= c && c <= '9' || c == '+' || c == '-' || c == '.': if i == 0 { return "",

Re: [go-nuts] Issue using json with array

2019-02-02 Thread Tomás González Dowling
Not sure if that was a question, Juan. But you can use Marshal method in the encoding/json package to avoid using make. There are some examples in the official docs: https://golang.org/pkg/encoding/json/#example_Marshal Hope that it helps :) El mié., 19 dic. 2018 a las 9:44, Juan Mamani () escrib

Re: [go-nuts] lock for assigning to different elements of an array

2019-02-02 Thread Michael Ellis
On Saturday, February 2, 2019 at 3:36:17 PM UTC-5, Jake Montgomery wrote: > > Always a good read on why that is still a problem: > Benign Data Races: What Could Possibly Go Wrong? > > It is not spe

Re: [go-nuts] lock for assigning to different elements of an array

2019-02-02 Thread Michael Ellis
On Friday, February 1, 2019 at 5:38:49 PM UTC-5, robert engels wrote: > > The pseudo code for the correct code would look like: > Robert, thanks very much for the clear explanation and correct example. I'd totally forgotten that Go is threaded underneath the hood and was thinking only in terms

Re: [go-nuts] lock for assigning to different elements of an array

2019-02-02 Thread jake6502
Always a good read on why that is still a problem: Benign Data Races: What Could Possibly Go Wrong? It is not specific to go, but mostly applies to any language, and is stuff all developers should k

Re: [go-nuts] Diagnose

2019-02-02 Thread Michael Jones
Original was January 22. On Fri, Feb 1, 2019 at 3:56 PM Michael Jones wrote: > This looks like the question asked a week ago. Look at the first post for > answers. > > On Fri, Feb 1, 2019 at 3:44 PM John wrote: > >> Dear Gophers, >> I have made a connect five game, and am planning to make it a

[go-nuts] Re: using docker for compiling

2019-02-02 Thread Keith Brown
Thanks. At the moment I use a Makefile (different from the above :-) ) . I suppose I am asking because I want to integrate vim-go with the docker build ( docker run -v $PWD:/mnt -w /mnt bash -c "go build main.go" ) Was wondering if anyone has done that before. On Friday, February 1, 2019 at

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-02 Thread sagar puneria
Thank you for investigating. On Friday, February 1, 2019 at 3:01:35 PM UTC+5:30, Inada Naoki wrote: > > Hello, I'm one of maintainer of go-sql-driver/mysql. > > When there is only one result set, you don't need NextResultSet(). > See this example. > > https://play.golang.org/p/rhm4Xp6WejB > > Then