[go-nuts] Re: Why not return after calling http.Error()

2023-07-04 Thread Volker Dobler
On Tuesday, 4 July 2023 at 17:39:05 UTC+2 Gurunandan Bhat wrote: Every example of http Handler that I have seen so far looks like this: This is very strange as basically all correct http Handlers I have seen in the last 10 years actually do return after http.Error. If all examples of http

Re: [go-nuts] Why not return after calling http.Error()

2023-07-04 Thread ben...@gmail.com
> Every example of http Handler that I have seen so far looks like this: Yes, that's definitely odd. I just grepped my Go source directory (which includes the Go compiler and stdlib and a bunch of other Go code), and almost all of them have a "return" on the next line. For example: $ rg

[go-nuts] Re: Gomobile broken on Xcode 14?

2023-07-04 Thread Scotty Davenport
For a quick repro, I think it's worth noting that: This does not work: gomobile bind -target=ios golang.org/x/mobile/example/bind/hello while this does: gomobile build -target=ios -bundleid=com.example golang.org/x/mobile/example/basic Le mardi 4 juillet 2023 à 17:35:02 UTC-4, Scotty Davenport

[go-nuts] Gomobile broken on Xcode 14?

2023-07-04 Thread Scotty Davenport
Dear Go Authors, I'm attempting to use gomobile to build an .xcframework to use inside an iOS application. MacOS: 13.4.1 Xcode: 14.3.1 (reproduced with 15.0 beta as well) Gomobile: go install golang.org/x/mobile/cmd/gomobile@latest (as of now) Unfortunately, when running `gomobile bind -v

[go-nuts] Re: Using Go/WASM for web app functions

2023-07-04 Thread Jason E. Aten
I haven't experimented with Go/WASM for some time, so my experience may be very out of date. But the size of the binaries back a while ago meant that most folks were using TinyGo. I would ask on the Gopher slack for more up to date experience, perhaps. Or you could use GopherJS which means you

[go-nuts] Using Go/WASM for web app functions

2023-07-04 Thread Mandolyte
In a few months I will begin working on a component that can be used by several of our web apps. Since I have time I wanted to experiment with writing this in Go/WASM. The Go code will be a set of functions that take a string and some options (probably in JSON format) and return a string

Re: [go-nuts] Why not return after calling http.Error()

2023-07-04 Thread Jan Mercl
On Tue, Jul 4, 2023 at 5:38 PM Gurunandan Bhat wrote: > Every example of http Handler that I have seen so far looks like this: > > func handleSomeRequest(w http.ResponseWriter, r *http.Request) { > > // do something that returns an error > if err != nil { > http.Error(w,

[go-nuts] Why not return after calling http.Error()

2023-07-04 Thread Gurunandan Bhat
Every example of http Handler that I have seen so far looks like this: func handleSomeRequest(w http.ResponseWriter, r *http.Request) { // do something that returns an error if err != nil { http.Error(w, "Something bad happened", http.SomeAppropriateStatus) } // do other