[go-nuts] contenox/runtime: An open-source state machine for GenAI workflows in Go

2025-08-30 Thread 'Alexander Ertli' via golang-nuts
Hi everyone, I'm excited to share a project I've been heads-down on for the better part of this year: an LLM backend management and orchestration API written in Go. After a few failed attempts and several months of work, it's reached a point where I'd genuinely value feedback from developers w

Re: [go-nuts] Is calling With in slog for every log entry a performance issue?

2025-08-25 Thread 'Alexander Ertli' via golang-nuts
Hey, Don't think there is any mentionable overhead in doing that. ___ // WithAttrs returns a new [TextHandler] whose attributes consists // of h's attributes followed by attrs. func (h *TextHandler) WithAttrs(attrs []Attr) Handler { return &TextHandler{commonHandler: h.commonHandler.withAttrs(attr

Re: [go-nuts] Rounding to k digits

2025-08-13 Thread 'Alexander Ertli' via golang-nuts
Hi Jochen, I think it's possible with a trick. My first naive thought on how to solve this is to simply shift the decimal point over, do the rounding on the whole number, and then shift it back. import "math" // Round performs rounding by shifting the decimal, rounding, and shifting back. func Ro

Re: [go-nuts] The motivation for the use of length in copy function instead of the capacity

2025-05-28 Thread 'Alexander Ertli' via golang-nuts
Hi, I think the core reasoning is that once a slice is created, its capacity is fixed – you can’t really change it without allocating a new backing array and copying elements over. You *can* reduce the length easily (s = s[:n]), but not the capacity. ```a := make([]int, 0, 10) b := make([]int, 10

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

Re: [go-nuts] Re: url.ParseRequestURI validation of path

2025-05-15 Thread 'Alexander Ertli' via golang-nuts
Hi Diego, You're absolutely right to point out the flaw in my snippet, thanks for catching that. That said, my goal wasn't to provide a complete solution, but rather a minimal example to highlight the core issue. Judging from your ability to spot the edge case, I’m sure you’re more than capable of

Re: [go-nuts] Re: url.ParseRequestURI validation of path

2025-05-04 Thread 'Alexander Ertli' via golang-nuts
EscapedPath() sometimes re-generates the escaped path, especially if the original path contains unencoded characters like Ñ or literal spaces. When it does this reconstruction, it works from the decoded path segments, which is likely why the original %2F encoding was lost in your example. This seem

[go-nuts] Unexpected 301 Redirect with http.StripPrefix + nested http.ServeMux in Go 1.24.1?

2025-04-04 Thread 'Alexander Ertli' via golang-nuts
Hello, I'm encountering unexpected behavior with net/http routing in Go 1.24.1 (amd64, ubuntu linux) when using http.StripPrefix to delegate to a nested http.ServeMux which uses the Go 1.22+ METHOD /path routing syntax. Instead of the nested ServeMux executing its registered handlers for the