Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-26 Thread Paul Baker
> I'd consider both to be perfectly reasonable ways of going about > what you're doing. [...] And most of the time I would likely pick example 1 Thanks Nick. Example 1 is my preference as well - I'm a fan of the Zen of Python's "Explicit is better than implicit" and "Flat is better than nested".

Re: [go-nuts] eXtensible Markup for Go

2025-05-26 Thread Robert Engels
It’s already there. Read up on go templates. On May 26, 2025, at 4:42 PM, Hydroper wrote:I have been looking for whether Go could be used for creating user-facing apps. If so, it would be useful to support eXtensible markup directly nested in Go code, in the form of eXtensible Markup Language (XM

[go-nuts] eXtensible Markup for Go

2025-05-26 Thread Hydroper
I have been looking for whether Go could be used for creating user-facing apps. If so, it would be useful to support eXtensible markup directly nested in Go code, in the form of eXtensible Markup Language (XML), which translates to complex nodes that may be used for rendering GUI in reactive mo

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Robert Engels
Not my observation - it’s in the Go docs :)On May 26, 2025, at 2:51 PM, Jason E. Aten wrote:Interesting observation, thanks Robert!  I'll have to think about that more.Off the cuff, I don't think they mutually exclusive. Randomness might benefit liveness properties too/not just a safety ones.On M

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Jason E. Aten
Interesting observation, thanks Robert! I'll have to think about that more. Off the cuff, I don't think they mutually exclusive. Randomness might benefit liveness properties too/not just a safety ones. On Monday, May 26, 2025 at 12:58:17 PM UTC+1 Robert Engels wrote: I am pretty sure that isn

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Robert Engels
I am pretty sure that isn’t correct. You can still easily create deadlocks. The reason it is random is to avoid channel starvation. On May 26, 2025, at 2:09 AM, Jason E. Aten wrote:Since I've been researching reproducible simulation testing recently, andthinking about how to maximize determinism,

Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-26 Thread Nick White
Hi Paul, On Sun, May 25, 2025 at 03:08:12PM +1000, Paul Baker wrote: > Should I prefer one over the other? Which of these (if either) would > be considered idiomatic? > > 1. > {{- $resource := .Page.Resources.Get $path -}} > {{- $lines := split $resource.Content "\n" | after $skip_lines -}} > {{-

Re: [go-nuts] Spooky: http.Error(w, [text], [statusCode]) responds the code without the text

2025-05-26 Thread 'Alexander Ertli' via golang-nuts
Hey! I saw your post and to me it looks like the issue is in your JavaScript code. You're using response.statusText, which is *not* the response body. It's expected to see exactly what you're observing, because statusText just gives you the standard reason phrase for the status code (like "Forbidd

[go-nuts] Spooky: http.Error(w, [text], [statusCode]) responds the code without the text

2025-05-26 Thread Zhaoxun Yan
Hi All! I am stuck with this bizarre phenomenon that the http.Error function does not repond with the customizable text defined by the second argument. Suppose a simple ill http server with this function that responds an error as always: -- func (con *Net) ServeHTTP(w ht

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Jason E. Aten
Since I've been researching reproducible simulation testing recently, and thinking about how to maximize determinism, I was reading this two year old thread. I had a "lightbulb over the head" moment. I realized _why_ Go's select statement, from CSP, from Dijkstra's guarded commands, is specifie