home.social

#golang — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #golang, aggregated by home.social.

  1. Падающая сборка, и это я её просил

    Три способа тихо сломать приложение сборкой зависимостей: два пула к базе, не тот кэш, разъехавшиеся ветки конфигурации. Компилятор их не ловит — типы верные. Рантайм-контейнеры ловят половину и приносят свои отказы. Про diogen — compile-time DI для Go: внедрение зависимостей на этапе компиляции, обычный Go-код на выходе, без рантайм-контейнера и без рефлексии.

    habr.com/ru/articles/1082060/

    #dependency_injection #внедрение_зависимостей #di #go #golang #кодогенерация #wire #fx #diogen #gorib

  2. I've been neck deep in the PNG spec writing the metadata decoder/encoder for EXIF, XMP, IPTC, and native text. I do enjoy me some byte-level work.

  3. Валидатор не нашёл поле is_admin, а Go его нашёл: пять ошибок при работе с JSON

    Один и тот же JSON может привести систему к разным выводам. Валидатор пропустит поле, которое Go‑сервис спокойно прочитает, nil ‑слайс превратится в неожиданный для клиента null , а ошибка в имени параметра останется незамеченной до самого продакшена. Разбираем пять случаев, где поведение encoding/json в Go способно создать расхождение между компонентами системы, и смотрим, что меняет переход на encoding/json/v2 . Узнать детали

    habr.com/ru/companies/otus/art

    #Go #Golang #JSON #API #backend #микросервисы #валидация_данных #сериализация #безопасность_приложений #разработка_ПО

  4. NginXplorer: Because Spinning Up a 2GB Grafana Stack Just to Watch Nginx Logs is Madness

    It usually starts with an innocent thought on a Friday evening. You’re logged into a low-powered VPS or your homelab machine, and you notice your blog is feeling a bit sluggish. Or maybe you noticed a suspicious spike in inbound network bandwidth and you just want to know: Who is hammering my web server right now, what URLs are they hitting, and how badly is my upstream PHP-FPM or reverse proxy sweating? Naturally, you look at your options in 2026: The “Modern Cloud-Native” […]

    schulz.dk/2026/09/14/nginxplor

  5. Most guides I found on Go backend services cover the code inside the service, with little on the production problems around it: configuration, lifecycle, observability, packaging, deployment.
    My new guide, Building a Production REST API in Go, covers all of these alongside a working example service: tecnick.com/guides/go-rest-api/
    #golang #restapi #backend #softwareengineering

  6. Hey #golang folks, I have a service listening on some port (say 4321) and the #systemd service file has
    ```
    SocketBindAllow=tcp:4321
    SocketBindDeny=any
    ```

    When my service makes an _outgoing_ connection by calling
    ```
    var dialer net.Dialer
    dialer.DialContext(ctx, "tcp", "somehost.example.com:5678")
    ```
    the service gets a permission error for violating the SocketBind* systemd restrictions.

    But only when using the cgo resolver. Setting `GODEBUG=netdns=go` fixes the error. So what is the cgo resolver doing that requires binding a socket?

  7. Hey folks, I have a service listening on some port (say 4321) and the service file has
    ```
    SocketBindAllow=tcp:4321
    SocketBindDeny=any
    ```

    When my service makes an _outgoing_ connection by calling
    ```
    var dialer net.Dialer
    dialer.DialContext(ctx, "tcp", "somehost.example.com:5678")
    ```
    the service gets a permission error for violating the SocketBind* systemd restrictions.

    But only when using the cgo resolver. Setting `GODEBUG=netdns=go` fixes the error. So what is the cgo resolver doing that requires binding a socket?

  8. Hey #golang folks, I have a service listening on some port (say 4321) and the #systemd service file has
    ```
    SocketBindAllow=tcp:4321
    SocketBindDeny=any
    ```

    When my service makes an _outgoing_ connection by calling
    ```
    var dialer net.Dialer
    dialer.DialContext(ctx, "tcp", "somehost.example.com:5678")
    ```
    the service gets a permission error for violating the SocketBind* systemd restrictions.

    But only when using the cgo resolver. Setting `GODEBUG=netdns=go` fixes the error. So what is the cgo resolver doing that requires binding a socket?

  9. Hey #golang folks, I have a service listening on some port (say 4321) and the #systemd service file has
    ```
    SocketBindAllow=tcp:4321
    SocketBindDeny=any
    ```

    When my service makes an _outgoing_ connection by calling
    ```
    var dialer net.Dialer
    dialer.DialContext(ctx, "tcp", "somehost.example.com:5678")
    ```
    the service gets a permission error for violating the SocketBind* systemd restrictions.

    But only when using the cgo resolver. Setting `GODEBUG=netdns=go` fixes the error. So what is the cgo resolver doing that requires binding a socket?

  10. Hey #golang folks, I have a service listening on some port (say 4321) and the #systemd service file has
    ```
    SocketBindAllow=tcp:4321
    SocketBindDeny=any
    ```

    When my service makes an _outgoing_ connection by calling
    ```
    var dialer net.Dialer
    dialer.DialContext(ctx, "tcp", "somehost.example.com:5678")
    ```
    the service gets a permission error for violating the SocketBind* systemd restrictions.

    But only when using the cgo resolver. Setting `GODEBUG=netdns=go` fixes the error. So what is the cgo resolver doing that requires binding a socket?

  11. Trying to understand #golang. It seems to have quite some "implicit (and short) is better than explicit (and longer)"-features 🙄

  12. WGX is now ihasvpn, and it's been rewritten from scratch.

    The old WGX was a Bash installer that assembled a VPN on your host. The new one is a WireGuard server of its own: one static Go binary in one container, driving kernel WireGuard over netlink, with a web console built in.

    Free software, AGPL-3.0.

    jcoffey.dev/articles/wgx-is-no

    #WireGuard #SelfHosted #Golang #OpenSource #VPN

  13. WGX is now ihasvpn, and it's been rewritten from scratch.

    The old WGX was a Bash installer that assembled a VPN on your host. The new one is a WireGuard server of its own: one static Go binary in one container, driving kernel WireGuard over netlink, with a web console built in.

    Free software, AGPL-3.0.

    jcoffey.dev/articles/wgx-is-no

    #WireGuard #SelfHosted #Golang #OpenSource #VPN

  14. WGX is now ihasvpn, and it's been rewritten from scratch.

    The old WGX was a Bash installer that assembled a VPN on your host. The new one is a WireGuard server of its own: one static Go binary in one container, driving kernel WireGuard over netlink, with a web console built in.

    Free software, AGPL-3.0.

    jcoffey.dev/articles/wgx-is-no

    #WireGuard #SelfHosted #Golang #OpenSource #VPN

  15. I'm sure many older programmers will grunt at seeing this mentioned, but as much as AI annoys me just as much as the next guy (because of AI slop, increased hardware costs and stuff like that)...

    ... I can't deny that it feels like it's easier than ever to start learning to program these days.

    You've got yourself a personal tutor who guides you through step by step and answers all of your questions you might be wondering.

    You'll never be completely stuck.

    Learning #Golang with Gemini atm

  16. After a ton of compiling, the v2 release is official. Containers all work, the client works, and now I'm gonna relax and watch some YouTube videos. Releases are available on the website though I still need to update the docs with the new "installation" process (much simplified).

    Releases: git.jamesthebard.net/jweatherl

    #sisyphus #encoding #programming #golang

  17. The long test is looking good for the `av1an`, `mkvmerge`, and `cleanup` modules, the Golang client is doing exactly what its supposed to which is a welcome change from yesterday. I need to do long tests on the `ffmpeg` and `handbrake` modules next, but I'll handle those tomorrow.

    After that, I'll update documentation, release the `2.0.0` client, and deprecate the old client.

    #sisyphus #av1an #ffmpeg #matroska #encoding #programming #golang

  18. Lots of progress and a lots of pain. However, all of the Sisyphus modules have been implemented and I'm currently running a test across the `2.0.0b2` version. The most painful thing I fought was literally tailing a log file. Got lazy and brought in `hpcloud/tail` because it did what I needed it to, but what it _didn't_ do was work well for my application. After a day or two of battling it, I removed it and went with `bufio.NewReader`and a nice `context.CloseWith` setup and now it works every time.

    Also added a `PostRun()` call to each module just to have a place to do basic module cleanup if needed.

    Learned a ton on this one so far and while annoying at times: it's been pretty fun.

    Repo: git.jamesthebard.net/jweatherl

    #golang #sisyphus #encoding #programming

  19. Ah previous me...I see you've decided to make this rewrite more difficult because you got _clever_ and I decided to keep backward compatibility. Thought that the `ffmpeg` module would be the biggest pain in the ass, but I was completely wrong. The `mkvmerge` part is coming along and I'm hoping to have it done today or tomorrow. Things progress.

    #matroska #mkvmerge #sisyphus #golang

  20. The Sisyphus client rewrite continues after a bit of a break. The `ffmpeg` module is mostly finished and should serve as a good template for `handbrake`, `av1an`, `mkvmerge`, and `cleanup` modules. Logging is progressing pretty well. The config has been expanded slightly and can now pull from TOML files on top of the standard environment variables.

    #sisyphus #encoding #ffmpeg #golang