home.social

#golang — Public Fediverse posts

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

  1. 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.

  2. Валидатор не нашёл поле 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 #микросервисы #валидация_данных #сериализация #безопасность_приложений #разработка_ПО

  3. 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

  4. 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

  5. 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?

  6. 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?

  7. 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?

  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. Trying to understand #golang. It seems to have quite some "implicit (and short) is better than explicit (and longer)"-features 🙄

  11. 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

  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. 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

  15. After reading about Hyrum-proofing in encoding/json/v2 I made a tiny errors compatible module doing exactly that.

    codeberg.org/vyskocilm/herrors

    #golang