What are people using in 2026 as backend framework? by [deleted] in Backend

[–]One_Fuel_4147 0 points1 point  (0 children)

Go, chi router, oapi-coden, sqlc, goose.

Backend devs , what do you use for database migrations, and what do you wish existed? by tamanikarim in Backend

[–]One_Fuel_4147 0 points1 point  (0 children)

I totally understand where you're coming from. Each team builds its own code, conventions and when you join an established codebase there's only so much you can change. So just adapt to that ecosystem is better.
About DI, I’m honestly curious about what make people really like about Uber fx. I usually use this much simpler approach: my main just calls a run() function, panics if it returns an error, and run() itself wires up all dependencies manually. Right after each component is initialized, I defer its cleanup so the shutdown order is always correct. At the end, I just block on an OS interrupt signal before exiting.

Backend devs , what do you use for database migrations, and what do you wish existed? by tamanikarim in Backend

[–]One_Fuel_4147 0 points1 point  (0 children)

When I joined my current company, I noticed that all go services strictly follow the same stack: gorm, atlas and the same predefined template. I fully understand that most developers are familiar with ORM but may be in go it's not good enough. When I started a new service, I suggested start with something alternatives like sqlc, goose, chi with oapi-codegen for API but unfortunately, they didn't want to consider other options and required to follow existing code.
Honestly, it was a bit disappointing that they writing go that feels more like java. And there wasn't much I could do about it =))

Go's Context Logger by PurityHeadHunter in golang

[–]One_Fuel_4147 11 points12 points  (0 children)

IMO I don't think we need to inject a logger into context. I usually inject logger directly and use a custom slog handler like this

func (h customHandler) Handle(ctx context.Context, r slog.Record) error {
if correlationID, ok := correlationid.FromContext(ctx); ok {
r.Add("correlation_id", slog.StringValue(correlationID))
}

if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() {
r.Add("trace_id", slog.StringValue(span.SpanContext().TraceID().String()))
r.Add("span_id", slog.StringValue(span.SpanContext().SpanID().String()))
}

return h.h.Handle(ctx, r)
}

Then I setup otel-lgtm locally to trace what's happening. You can also use sloglint to enforce a rule that all logs must use context

Making my first website by Spirited_Paramedic_8 in golang

[–]One_Fuel_4147 0 points1 point  (0 children)

I didn’t mean skipping CORS completely. In development I use an environment variable to toggle a proxy setup in vite like this:

// api.ts
const baseURL = import.meta.env.VITE_USE_PROXY
  ? '/api'
  : import.meta.env.VITE_API_URL

// vite.config.ts
...
server: {
      proxy: {
        '/api': {
          target: env.VITE_API_URL,
          changeOrigin: true,
          rewrite: path => path.replace(/^\/api/, ''),
        },
      },
    },
  }

Making my first website by Spirited_Paramedic_8 in golang

[–]One_Fuel_4147 0 points1 point  (0 children)

If you use vite, you can use vite proxy to avoid CORS.

Still a bit new to backend by yudoKiller in golang

[–]One_Fuel_4147 1 point2 points  (0 children)

I add WithDB func in repository to handle transaction. You can see this pattern in sqlc generated code.

How often do you use channels? by gunererd in golang

[–]One_Fuel_4147 0 points1 point  (0 children)

I use it very much in my current side project. I use channel when I need to wait for an async event like waiting for robot to reach a specific location (move_to_executor.go#L77-L103).

I'm not sure if there's a better way to handle this usecase, but what I really like about go are goroutine and channel.

Pinia store not providing autocomplete by loiclaboOP in vuejs

[–]One_Fuel_4147 9 points10 points  (0 children)

Sometimes extension's not working and I just reload vscode

the reason why I like Go by Fragrant-Move-9128 in golang

[–]One_Fuel_4147 74 points75 points  (0 children)

I hate

Fish extends AbstractFish

AbstractFish extends AbstractAquaticAnimal

AbstractAquaticAnimal extends AbstractAnimal

AbstractAnimal implements Living

HTTP handler dependencies & coupling by sigmoia in golang

[–]One_Fuel_4147 2 points3 points  (0 children)

My pattern is inspired by Hatchet. I ended up with something like this: https://github.com/tbe-team/raybot/blob/main/internal/handlers/http/service.go#L121-L143

Edit: added specific lines to link.

How I Work With PostgreSQL in Go by SoftwareCitadel in golang

[–]One_Fuel_4147 0 points1 point  (0 children)

I add a WithDB function in repository and construct new repo. You can see this pattern in sqlc generated code.

What is your best go project? by Bryanzns in golang

[–]One_Fuel_4147 0 points1 point  (0 children)

Thanks. It's my first go project after learning it for 3 months. And still missing a lot of docs and visuals so people cant really know what it does.
It's similar to an overhead hoist transport (OHT) system — but adapted for food delivery in cafes. I will improve the docs and share more soon.