[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Jérôme LAFORGE
I submit this issue https://github.com/golang/go/issues/46826 Le vendredi 18 juin 2021 à 21:15:54 UTC+2, Jérôme LAFORGE a écrit : > Sorry, I wasn't clear enough. > I know that panic comes from my code. It throws it. > But I wanted to show that error on Decode must not occur because the body >

Re: [go-nuts] syntax regex package

2021-06-18 Thread Kurtis Rader
On Fri, Jun 18, 2021 at 2:34 PM Pietro wrote: > I am trying to solve the problem of automatically translating a raft of > regexes which were originally intended for GNU sed but that I'd like to run > using GoLang, if feasible. > > I could not find any syntax options/settings for the regex

Re: [go-nuts] syscall/js documentation missing

2021-06-18 Thread 'Axel Wagner' via golang-nuts
I guess you have to specify GOOS/GOARCH to a combination that actually has API defined now: https://golang.org/pkg/syscall/js/?GOOS=js=wasm On Fri, Jun 18, 2021 at 11:28 PM Tor Langballe wrote: > Is anyone else seeing this? > > https://golang.org/pkg/syscall/js/ > > shows just a header

[go-nuts] syntax regex package

2021-06-18 Thread Pietro
Hi all, I am trying to solve the problem of automatically translating a raft of regexes which were originally intended for GNU sed but that I'd like to run using GoLang, if feasible. I could not find any syntax options/settings for the regex package which I am assuming is quite strict in its

[go-nuts] syscall/js documentation missing

2021-06-18 Thread Tor Langballe
Is anyone else seeing this? https://golang.org/pkg/syscall/js/ shows just a header paragraph about it being experimental. All the api documentation seems to be gone. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Re: It's possible to replace cgo memory allocator?

2021-06-18 Thread Diego Bernardes
Sorry for the late reply. The problem was solved, thanks to everyone for the help. Just to give a little more context. The lib that I'm using is MuPDF and I thought that I had a memory leak but in the end, it was just glibc not releasing the memory fast enough to the OS. I solved the problem

[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Jérôme LAFORGE
Sorry, I wasn't clear enough. I know that panic comes from my code. It throws it. But I wanted to show that error on Decode must not occur because the body is smaller than 8kB. The 2nd example works like this. The only difference between the two examples is just the response is discarded.

[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Sean Liao
I think it's working as expected? The panic originates in your code: ``` err := decoder.Decode() if err != nil { panic(err) } ``` What you should be doing is to break out of the loop and handle the error (client sending more than you want to read) gracefully On Friday, June 18, 2021 at 4:32:11

Re: [go-nuts] Re: vendoring related question/issue

2021-06-18 Thread Sachin Puranik
This is quite an open answer. The point I am trying to make is, why not all the files from the external library available in the vendor folder. why only selective. (selection is based on the build). These files can be txt , md , go , go test or zzz...doesn't matter. Ultimately it's the developer's

Re: [go-nuts] Re: vendoring related question/issue

2021-06-18 Thread Sachin Puranik
This seems like a good Idea...I will try and let you know soon. Thanks, Sachin. On Fri, Jun 18, 2021 at 6:16 PM jake...@gmail.com wrote: > I don't use vendor, so I'm just thinking here. If I understand correctly, > a "//go:embed" statement will cause the the target file to be included in > the

[go-nuts] unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Jérôme LAFORGE
Hello, I am facing to unexpected behavior when I want to limit the maximum body request and managing the request/response as streaming way. With this code https://play.golang.org/p/eN2XEpiPdhn, when I send the request, I have this unexpected error (whatever the max size): ``` 2021/06/18

Re: [go-nuts] Re: vendoring related question/issue

2021-06-18 Thread Chris Burkert
I believe you should distinguish between the build and the run environment. Your build environment is largely defined by the language and its ecosystem, e.g. the vendor folder has a semantic for the Go tools. After the build you deploy the resulting artifacts to your run environment. That may be

Re: [go-nuts] Re: vendoring related question/issue

2021-06-18 Thread jake...@gmail.com
I don't use vendor, so I'm just thinking here. If I understand correctly, a "//go:embed" statement will cause the the target file to be included in the vendor. If that is the case, then perhaps you could create a vendored_files.go file that embeds all the files you want vendored, then add a