Re: [go-nuts] bug on template on version >=1.14

2020-03-20 Thread Giulio De Donato
Hello Gregor,
thanks a lot with the html I reproduced the bug,
I also found the open issue,
https://github.com/golang/go/issues/33671
> FWIW, http://json.org agrees that \u escapes are valid JSON and \x 
escapes are not

my question was about if I was missing something, 
and I was missing the html/template and the open issue :)
thanks for your time.

G.

On Friday, 20 March 2020 16:00:15 UTC+1, Gregor Best wrote:
>
> Hi Guilio,
>
> the playground example is using `text/template`. If you use 
> `html/template` instead it'll also do the replacement. 
>
> The behaviour is part of `html/template`'s feature set, and as far as I 
> can remember (since at least 2015) has been present under the umbrella of 
> context aware escaping of special characters.
> On 20.03.20 11:40, liuggio wrote:
>
> Hello everybody, 
> we are issuing on our website a problem with templating,
>
> variable is: "+" 
> is converted to:  ""
> and inside the * the output of that function is:   
> "plain": ""   
> 

Re: [go-nuts] Issue with handler

2020-03-20 Thread Kurtis Rader
On Fri, Mar 20, 2020 at 11:50 AM Ali Hassan 
wrote:

> I have two html files
>index and login
>  Index return status = 200
>  login return status = 400
>
> Code snipnet
>

I didn't see any code. All I saw were two pictures that didn't make any
sense :-)

In other words, please post plain text or a link to play.golang.org.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
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 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD-ry7d7ZQ7hw0Tn82PgjmfOJq0E%3DG0abaP9AQiRTCwYYw%40mail.gmail.com.


Re: [go-nuts] Issue with handler

2020-03-20 Thread robert engels
You have no login.html file...

> On Mar 20, 2020, at 1:50 PM, Ali Hassan  wrote:
> 
> I have two html files 
>index and login 
>  Index return status = 200
>  login return status = 400
> 
> Code snipnet
>  
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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 
> https://groups.google.com/d/msgid/golang-nuts/134f806f-4b20-498e-8a2b-84cab511760d%40googlegroups.com
>  
> .
> 

-- 
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 
https://groups.google.com/d/msgid/golang-nuts/2A6E5C16-F87B-451E-B9E9-54F93A713666%40ix.netcom.com.


[go-nuts] Issue with handler

2020-03-20 Thread Ali Hassan
I have two html files 
   index and login 
 Index return status = 200
 login return status = 400

Code snipnet
 

[image: err2.JPG]

[image: error0.JPG]


-- 
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 
https://groups.google.com/d/msgid/golang-nuts/134f806f-4b20-498e-8a2b-84cab511760d%40googlegroups.com.


[go-nuts] bug on template on version >=1.14

2020-03-20 Thread liuggio
Hello everybody,
we are issuing on our website a problem with templating,

variable is: "+"
is converted to:  ""
and inside the *
  { "plain inside ld+json": "\x2b"  }

i created the running example https://play.golang.org/p/sGP2Y2KCXLg
but in the play.golang.org website the bug is not visible (maybe 'cause) it
uses the v1.13

on my local (mac) and also on golang-1.14-alpine the problem can be easily
reproduced.

this is breaking all the seo on our website,
and is this is breaking compatibility with the past version.
am I missing something?

thanks a lot.
Giulio

-- 
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 
https://groups.google.com/d/msgid/golang-nuts/CALphBct9bULDxwUebSSzhxUi%3D8BUyaDqcMchPPsBbj9CL-nWrA%40mail.gmail.com.


Re: [go-nuts] go build output depending on project structure

2020-03-20 Thread Nitish Saboo
Thank you Ian and Jake for the response.
Sure Ian, will go through it.

Thanks,
Nitish


On Thu, Mar 19, 2020 at 11:11 PM Ian Lance Taylor  wrote:

> It might help to read
> https://golang.org/cmd/go/#hdr-Package_lists_and_patterns, including
> the paragraph starting "As a special case, if the package list is a
> list of .go files from a single directory,"
>
> Ian
>
> On Thu, Mar 19, 2020 at 8:59 AM Jake Montgomery 
> wrote:
> >
> >
> >
> > On Thursday, March 19, 2020 at 10:21:31 AM UTC-4, Nitish Saboo wrote:
> >>
> >> Hi Jake,
> >>
> >> Is there some reason that you want, or need, to be using go build this
> way, by specifying files? Or is it just curiosity about how the tools work?
> >> >>There is no particular reason to use go build by specifying the
> files. I was trying different ways to compile the project and ended up with
> this scenario.
> >> I am curious to know the reason for this.
> >>
> >> The typical way to use go build is to build without specifying
> individual files. If you are using CGO, I would certainly recommend that
> you do it by building as a  package, just to keep things simple. Not that
> CGO is ever simple.
> >> >> I will try compiling the package without specifying the individual
> files.
> >
> >
> > Right, as I said, this is the standard way. You should always build the
> package this way, unless you have a specific use case that requires
> compiling a single file.
> >
> >> But the following case works all fine whether we pass the individual
> file or not.:
> >
> >
> > The reason that works is because the package you are building only
> contains one file, 'main.go'. The other files are actually in different
> packages, so they are pulled in by import. So `go build -v - x` builds the
> package `nitish`, which only contains one file, `main.go`. Since the
> package name is `nitish` you get an executable named `nitish`. `go build -v
> - x main.go` is a special use of the tool. I mostly use it for quick code
> tests, when the playground will not suffice, or for using go to write quick
> scripts. It will not build the package `nitish`, instead it will build only
> the single file, and produce an executable named after the file, in this
> case `main.exe`. Since the `nitish` package only contains one file, the
> result is otherwise the same (AFAIK).
> >
> > Hope this has some useful information.
> >>
> >>
> >> Case 1
> >> --
> >>
> >> I have a project called 'nitish' where the folder structure looks like
> the following:
> >>
> >> nitish
> >>main.go
> >>util
> >> util.go
> >>lib
> >> node.c
> >> node.h
> >> a.go
> >>
> >> When I try compiling this project in the following ways:
> >>
> >> 1) go build -v - x
> >>
> >> >> This creates a binary called 'nitish'
> >>
> >> 2)  go build -v - x main.go
> >>
> >> >>  This creates a binary called 'main'
> >>
> >> ldd output of both the binaries is the same.
> >>
> >> Thanks,
> >> Nitish
> >>
> >>
> >> On Thu, Mar 19, 2020 at 7:18 PM Jake Montgomery 
> wrote:
> >>>
> >>> Nitish,
> >>>
> >>> Is there some reason that you want, or need, to be using go build this
> way, by specifying files? Or is it just curiosity about how the tools work?
> >>> The typical way to use go build is to build without specifying
> individual files. If you are using CGO, I would certainly recommend that
> you do it by building as a  package, just to keep things simple. Not that
> CGO is ever simple.
> >>>
> >>>
> >>> On Wednesday, March 18, 2020 at 10:27:19 AM UTC-4, Nitish Saboo wrote:
> 
>  Hi Gregor,
> 
>  Do you mean like this 'go build -v -x main.go node.c' ? But it does
> not compile and gives the following output:
> 
>  WORK=/tmp/go-build714119815
>  named files must be .go files
> 
>  Thanks,
>  Nitish
> 
>  On Wed, Mar 18, 2020 at 7:44 PM Gregor Best 
> wrote:
> >
> > Hi,
> >
> > it looks like my initial reply wasn't entirely correct. It should
> build if you pass in both the `.go` file and the `.c` file.
> >
> > On 18.03.20 15:02, Nitish Saboo wrote:
> >
> > Hi Gregor,
> >
> > nitish
> >main.go
> >node.c
> >node.h
> >
> > I compiled using 'go build -v -x main.go'
> > But if my cgo directive is defined in main.go, this should have
> compiled successfully..right? But it fails with the following whereas 'go
> build -v -x' works fine.
> >
> > /tmp/go-build439591561/b001/_x002.o: In function
> `_cgo_5637ad3d75e4_Cfunc_load_pattern_db':
> > /tmp/go-build/cgo-gcc-prolog:86: undefined reference to
> `load_pattern_db'
> > collect2: error: ld returned 1 exit status
> >
> > package main
> >
> > //#include 
> > //#include "node.h"
> > import "C"
> > import (
> > "fmt"
> > _ "fmt"
> > "os"
> > "path"
> > "unsafe"
> > )
> >
> > Please let me know what am I missing here?
> >
> > 

Re: [go-nuts] libgo is more fast that grouting.

2020-03-20 Thread Chris Burkert
Do people ask for a Tesla with a combustion engine? No because they value
what Tesla is doing and why they are doing it. And neither Tesla nor
Kubernetes or Docker are research projects. So please don’t whine about how
things are. Instead (as Ian said) participate in a positive manner and
contribute to make things better. The code of conduct is a good starting
point: https://golang.org/conduct

'Benjamin' via golang-nuts  schrieb am Fr.
20. März 2020 um 06:52:

> I think the team of go programming language should invite other people
> that out of google join some part of the project. And you all can have more
> free time.
>
> Sometimes Lazy is good habit. It’s 10+ years, go should not be a research
> project now. How Many 10 years do you have?  Like what is the binary
> package file of go? c/c++ have dll/so file, java has jar file, even php has
> a phar file.
>
> Guess what this project will happen when you all leave google? Only
> projects like PHP and Python and Java are real open source community driven
> project. They are all not belong to any company.
>
>
>
> > On Mar 19, 2020, at 00:00, Ian Lance Taylor  wrote:
> >
> > On Tue, Mar 17, 2020 at 11:12 PM 'Benjamin' via golang-nuts
> >  wrote:
> >>
> >> Benchmark shows that lingo is faster than goroutine.
> >>
> >> Many china internet companies use similar c++ libraries to support
> trillions of concurrency.
> >> Like Tencent use a smiler project libco:
> >> https://github.com/Tencent/libco
> >>
> >> I think the go team should learn some idea from these projects.
> >> NOT invent new thing is not necessary, its waste of time. Not all
> developers have 10+ years time to wait a new programming language become
> maturity .
> >
> > Go is an open source project.  I encourage you, and anyone who is
> > interested, to investigate these libraries to understand why they are
> > faster, and what Go can do to speed up.  The more people work on Go,
> > the less time everyone will have to wait for better performance.
> > Thanks.
> >
> > Ian
>
> --
> 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
> https://groups.google.com/d/msgid/golang-nuts/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com
> .
>

-- 
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 
https://groups.google.com/d/msgid/golang-nuts/CALWqRZp-27ukWRVEzQO5qDWK0b%3DQOiM3y-QWTi-Shyv0wpS%3Dfg%40mail.gmail.com.


Re: [go-nuts] libgo is more fast that grouting.

2020-03-20 Thread Dan Kortschak
Can you please stop. Numerous non-Google employees contribute to Go. It
is not a research project any more than any activity in life is a
research project.

On Fri, 2020-03-20 at 13:52 +0800, 'Benjamin' via golang-nuts wrote:
> I think the team of go programming language should invite other
> people that out of google join some part of the project. And you all
> can have more free time.
> 
> Sometimes Lazy is good habit. It’s 10+ years, go should not be a
> research project now. How Many 10 years do you have?  Like what is
> the binary package file of go? c/c++ have dll/so file, java has jar
> file, even php has a phar file.
> 
> Guess what this project will happen when you all leave google? Only
> projects like PHP and Python and Java are real open source community
> driven project. They are all not belong to any company.
> 
> 
> 
> > On Mar 19, 2020, at 00:00, Ian Lance Taylor 
> > wrote:
> > 
> > On Tue, Mar 17, 2020 at 11:12 PM 'Benjamin' via golang-nuts
> >  wrote:
> > > 
> > > Benchmark shows that lingo is faster than goroutine.
> > > 
> > > Many china internet companies use similar c++ libraries to
> > > support trillions of concurrency.
> > > Like Tencent use a smiler project libco:
> > > https://github.com/Tencent/libco
> > > 
> > > I think the go team should learn some idea from these projects.
> > > NOT invent new thing is not necessary, its waste of time. Not all
> > > developers have 10+ years time to wait a new programming language
> > > become maturity .
> > 
> > Go is an open source project.  I encourage you, and anyone who is
> > interested, to investigate these libraries to understand why they
> > are
> > faster, and what Go can do to speed up.  The more people work on
> > Go,
> > the less time everyone will have to wait for better performance.
> > Thanks.
> > 
> > Ian
> 
> --
> 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 
> https://groups.google.com/d/msgid/golang-nuts/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com
> .


-- 
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 
https://groups.google.com/d/msgid/golang-nuts/52081eaed9b412af653b917b374b53200a2c1bc4.camel%40kortschak.io.


Re: [go-nuts] How to clean cache for 'go tool dist test'

2020-03-20 Thread xiangdong...@gmail.com
I always got a timeout when running all.bash (synced to the latest commit 
cbd421f75b0770c3534d1b641e7770bf1878004f),
it's not reproducible with 'go test -run=. crypto/tls', no GOARCH and GOOS 
were set previously. Thanks.


*02:58:18* panic: test timed out after 9m0s*02:58:18* *02:58:18* goroutine 474 
[running]:*02:58:18* testing.(*M).startAlarm.func1()*02:58:18*   
/home/root/ci-scripts/golang/src/testing/testing.go:1492 +0xc8*02:58:18* 
created by time.goFunc*02:58:18*   
/home/root/ci-scripts/golang/src/time/sleep.go:169 +0x40*02:58:18* *02:58:18* 
goroutine 1 [chan receive, 8 minutes]:*02:58:18* testing.(*T).Run(0x4000592000, 
0x353e41, 0x11, 0x3742c8, 0x5e73be01)*02:58:18*   
/home/root/ci-scripts/golang/src/testing/testing.go:1045 +0x2e0*02:58:18* 
testing.runTests.func1(0x40003ca360)*02:58:18*
/home/root/ci-scripts/golang/src/testing/testing.go:1313 +0x74*02:58:18* 
testing.tRunner(0x40003ca360, 0x40008e1c48)*02:58:18*  
/home/root/ci-scripts/golang/src/testing/testing.go:993 +0xdc*02:58:18* 
testing.runTests(0x40008e2360, 0x612880, 0x87, 0x87, 0xbf950e12a0c70f0b, 
0x7dbd29bde6, 0x6167a0, 0x0)*02:58:18* 
/home/root/ci-scripts/golang/src/testing/testing.go:1311 +0x294*02:58:18* 
testing.(*M).Run(0x40003f8180, 0x0)*02:58:18* 
/home/root/ci-scripts/golang/src/testing/testing.go:1221 +0x1b4*02:58:18* 
crypto/tls.runMain(0x40003f8180, 0x0)*02:58:18*   
/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:389 
+0x55c*02:58:18* crypto/tls.TestMain(0x40003f8180)*02:58:18*  
/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:335 
+0x8c*02:58:18* main.main()*02:58:18* _testmain.go:321 +0x160*02:58:18* 
*02:58:18* goroutine 246 [IO wait, 8 minutes]:*02:58:18* 
internal/poll.runtime_pollWait(0x5bccbf78, 0x72, 0x0)*02:58:18*  
/home/root/ci-scripts/golang/src/runtime/netpoll.go:203 +0x44*02:58:18* 
internal/poll.(*pollDesc).wait(0x40003f8218, 0x72, 0x0, 0x0, 
0x3505d4)*02:58:18*
/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:87 
+0x38*02:58:18* internal/poll.(*pollDesc).waitRead(...)*02:58:18*  
/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:92*02:58:18* 
internal/poll.(*FD).Accept(0x40003f8200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
0x0)*02:58:18*/home/root/ci-scripts/golang/src/internal/poll/fd_unix.go:384 
+0x184*02:58:18* net.(*netFD).accept(0x40003f8200, 0x37e11d600, 0x0, 
0x40003823b8)*02:58:18*  
/home/root/ci-scripts/golang/src/net/fd_unix.go:238 +0x2c*02:58:18* 
net.(*TCPListener).accept(0x4000853ae0, 0x400053dfa8, 0x1, 0x222884)*02:58:18*  
/home/root/ci-scripts/golang/src/net/tcpsock_posix.go:139 +0x2c*02:58:18* 
net.(*TCPListener).Accept(0x4000853ae0, 0x400053dfa8, 0x4000646020, 0x0, 
0x0)*02:58:18*   /home/root/ci-scripts/golang/src/net/tcpsock.go:261 
+0x5c*02:58:18* crypto/tls.localServer(0x3e0880, 0x4000853ae0)*02:58:18*
/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:249 
+0x5c*02:58:18* created by crypto/tls.runMain*02:58:18*   
/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:361 
+0x21c*02:58:18* *02:58:18* goroutine 411 [semacquire, 8 minutes]:*02:58:18* 
internal/poll.runtime_Semacquire(0x40003f85a8)*02:58:18* 
/home/root/ci-scripts/golang/src/runtime/sema.go:61 +0x38*02:58:18* 
internal/poll.(*FD).Close(0x40003f8580, 0x40003f8580, 0x0)*02:58:18*
/home/root/ci-scripts/golang/src/internal/poll/fd_unix.go:109 +0x84*02:58:18* 
net.(*netFD).Close(0x40003f8580, 0x0, 0x0)*02:58:18*  
/home/root/ci-scripts/golang/src/net/fd_unix.go:184 +0x48*02:58:18* 
net.(*conn).Close(0x410040, 0x0, 0x0)*02:58:18* 
/home/root/ci-scripts/golang/src/net/net.go:208 +0x58*02:58:18* 
crypto/tls.TestHostnameInSNI(0x4000592000)*02:58:18*
/home/root/ci-scripts/golang/src/crypto/tls/handshake_client_test.go:1349 
+0x264*02:58:18* testing.tRunner(0x4000592000, 0x3742c8)*02:58:18*
/home/root/ci-scripts/golang/src/testing/testing.go:993 +0xdc*02:58:18* created 
by testing.(*T).Run*02:58:18*   
/home/root/ci-scripts/golang/src/testing/testing.go:1044 +0x2c4*02:58:18* 
*02:58:18* goroutine 317 [IO wait, 8 minutes]:*02:58:18* 
internal/poll.runtime_pollWait(0x5bccbb18, 0x72, 
0x)*02:58:18*   
/home/root/ci-scripts/golang/src/runtime/netpoll.go:203 +0x44*02:58:18* 
internal/poll.(*pollDesc).wait(0x40003f8598, 0x72, 0x200, 0x205, 
0x)*02:58:18*  
/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:87 
+0x38*02:58:18* internal/poll.(*pollDesc).waitRead(...)*02:58:18*  
/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:92*02:58:18* 
internal/poll.(*FD).Read(0x40003f8580, 0x4000494480, 0x205, 0x205, 0x0, 0x0, 
0x0)*02:58:18*  
/home/root/ci-scripts/golang/src/internal/poll/fd_unix.go:169 +0x158*02:58:18* 
net.(*netFD).Read(0x40003f8580, 0x4000494480, 0x205, 0x205, 0x40004938b8, 
0x82991c28, 0x4000493958)*02:58:18*