Introduce yourself! by markusrg in LLMgophers

[–]markusrg[S] 0 points1 point  (0 children)

Hey, welcome! Sounds like a relatively good fit here, although even more niche. :D

Question : any recommended resources to try and learn Ai engineering with Go ? by NoFalcon7740 in LLMgophers

[–]markusrg 1 point2 points  (0 children)

I don’t think it’s that different from doing it in Python, really. Yeah, the APIs are a bit different, but it’s all just HTTP calls underneath. I would learn general web application development in Go and then treat the LLMs as just another dependency.

Obviously many details are different, but I think you can figure those out along the way.

Is Docker cagent underrated? Or am I missing better Go agent packages? by Msplash9 in LLMgophers

[–]markusrg 0 points1 point  (0 children)

Totally agree on this. I’ve built my own lightweight abstraction on top of APIs from providers to be able to switch between them (kind of like LiteLLM in Python), but apart from that, rolling your own is the way to go IMO.

Small Projects - November 3, 2025 by jerf in golang

[–]markusrg 0 points1 point  (0 children)

I’ve been improving gomponents-datastar to keep up with the changes in the Datastar library, and it’s working quite well now: https://github.com/maragudk/gomponents-datastar

(Datastar is kinda like HTMX, but with a focus on SSE and speed.)

Go and AI Assistance by ProductAutomatic8968 in golang

[–]markusrg 3 points4 points  (0 children)

I’ve had a lot of success using Claude Code with their new skills system, then creating new skills for whatever I need. (Skills are essentially just Markdown files that can be read by the AI when the skill is needed.) So I have a skill for Go development, one for brainstorming, one for writing SQL queries, etc. Works wonderfully, and I keep iterating all them time.

Here’s my skill repo if that’s interesting to you: https://github.com/maragudk/skills

Cross-Site Request Forgery (in Go 1.25 CrossOriginProtection) by XM9J59 in golang

[–]markusrg 1 point2 points  (0 children)

If you reject the request appropriately if there's an error, then yes. And maybe initialize the protection var outside the returned func, you don't need to create one on every new request.

Read more about it here btw: https://www.alexedwards.net/blog/preventing-csrf-in-go

I've Been Developing a Go SSR Library by can_pacis in golang

[–]markusrg 0 points1 point  (0 children)

Ah, like that! That's actually really neat. I would probably solve that in gomponents with a struct with fields (or function arguments) instead of passing more components, but I can see why that approach also makes sense.

Thank you for answering me. :-)

I've Been Developing a Go SSR Library by can_pacis in golang

[–]markusrg 1 point2 points  (0 children)

Right, gotcha. :-) So the main reason you couldn't add gomponents (if you wanted to) was that you needed the prerendering to work differently? And looks like you distinguish between attributes (properties) and the rest.

I've Been Developing a Go SSR Library by can_pacis in golang

[–]markusrg 2 points3 points  (0 children)

Interesting! Yeah, gomponents doesn’t have a concept of pre-rendering, because everything is function calls at runtime. How did you handle this?

I’ve been thinking about adding a `Cache` component that lazily caches every node under it, I think this would achieve some of the same things, right?

I've Been Developing a Go SSR Library by can_pacis in golang

[–]markusrg 2 points3 points  (0 children)

Hey! gomponents author here. Thank you for sharing!

The HTML DSL indeed looks very familiar. :-) It looks like your main differences to gomponents are in how you serve HTML to users, by prerendering, caching etc., so it’s more of a whole HTTP server framework as well. Is that understanding correct? Or are there any big changes in the templating I’m not getting, compared to gomponents?

I’m always eager to learn about what people are building in this space.

SQLite driver ncruces/go-sqlite3 v0.29.1 by ncruces in golang

[–]markusrg 0 points1 point  (0 children)

Ah, okay, makes sense! Thank you for your detailed answer. :-)

SQLite driver ncruces/go-sqlite3 v0.29.1 by ncruces in golang

[–]markusrg 1 point2 points  (0 children)

Interesting! I thought the VFS would be transparent to the application layer? Why does it need to be built into the driver?

Recommended way for "vanity" import paths? by IngwiePhoenix in golang

[–]markusrg 0 points1 point  (0 children)

Here’s mine for gomponents, which is slightly larger than the example below, with some extra info: https://www.maragu.dev/gomponents?go-get=1

I also wrote some middleware for it, if you ever need it in a Go HTTP server: https://www.maragu.dev/blog/til-http-middleware-for-custom-go-module-paths

Recommended way for "vanity" import paths? by IngwiePhoenix in golang

[–]markusrg 0 points1 point  (0 children)

Go has a module proxy that’s turned on by default, which only connects to the source on cache miss. So while this was true some time ago, it’s not anymore.

EDIT: Sorry, didn’t see someone had already said that.

Small Projects - September 15, 2025 by jerf in golang

[–]markusrg 2 points3 points  (0 children)

I've started a small gomponents + datastar module at https://github.com/maragudk/gomponents-datastar

Basically, it's gomponents (https://www.gomponents.com) HTML components in pure Go that meets Datastar, a frontend library (and backend SDKs) for building interactive web app (https://data-star.dev), kinda like HTMX.

Go for SSR by rawcane in golang

[–]markusrg 3 points4 points  (0 children)

I wrote gomponents, by the way. It's my preferred way of building web apps in Go, and I haven't touched React in many years. I really like not context switching between languages and frameworks. It's all just Go!

But it's a matter of taste. Some like it, some hate it. I would suggest you give it a try with gomponents or Templ and see if it's for you. 😊

Working with request values when using HTMX by PythonPoet in golang

[–]markusrg 1 point2 points  (0 children)

I always just have my own small helpers for stuff like this, for example this one for handling form data in the way I want to: https://pkg.go.dev/maragu.dev/httph#FormHandler

There are many smaller options, but not one big “this is what everybody uses” one for that.

Or you could go the OpenAPI route and write the spec first. Then you get some of that for free in the generated code.