Golang

2217 readers
1 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 1 year ago
MODERATORS
26
27
28
 
 

go1.22.2 (released 2024-04-03) includes a security fix to the net/http package, as well as bug fixes to the compiler, the go command, the linker, and the encoding/gob, go/types, net/http, and runtime/trace packages. See the Go 1.22.2 milestone on our issue tracker for details.

29
19
Go Enums Still Suck (www.zarl.dev)
submitted 8 months ago by bugsmith to c/golang
30
 
 

cross-posted from: https://midwest.social/post/9890016

Rook, a secret service backed by Keepass 4.x kdbx

Howdy Lemmy,

I'm announcing Rook v0.0.9, software that provides a secret service a-la secret-tool, keyring, or pass/gopass, except backed by a Keepass 4.x kdbx file.

The problem Rook solves is mainly in script automation, where you have aerc, offlineimap, isync, vdirsyncer, msmtp, restic, or any other cron jobs that need passwords and which are often configured to fetch these passwords from a secret service with a CLI tool. Unlike existing solutions, Rook is headless and does not have a bespoke secrets database, full of passwords that must be manually synchronized with Keepass; instead, it uses a Keepass db directly.

While the readme goes into more detail, I will say the motivation for Rook evolved from a desire to use a Keepass db in a GUI-less environment and finding no existing solutions. KeepassXC provides a secret service, but is not headless; it also provides a CLI tool, but this requires the db credentials on every call. kpmenu exists, but is designed specifically to require human interaction and is unsuitable for cron environment scripting. Every other solution maintains its own DB back end, incompatible with Keepass.

Rook also benefits from minimal external dependencies, and at 1kloc is auditable by developers - I believe even by ones who do not know Go (the language of implementation). Being able to verify for yourself that there's no malicious code is a critical trait for a tool with which you're trusting secrets.

Rook is fit for purpose, and signed binaries are provided as well as build-from-source instructions (for auditors).

The project contains work in progress: credentials are limited to simple password-locked kdbx, and so doesn't yet support key files. Bash scripts that provide autotyping and attribute/secret selection via rofi, fzf, and xdotool are provided, for GUI environments; these have known bugs. Rook has not been tested on BSD, Darwin, or any other system than Linux, but may well work; the main sticking point is the use of a local file socket for client/server communication, so POSIX systems should be fine, but still, YMMV.

As a final caveat: up until v0.0.9 I've been compressing with brotli, which is very nice yet somewhat obscure. With the next release, everything will be gzipped. Also included in the next release will be packages for various distributions.

31
32
15
Go Enums Suck (www.zarl.dev)
submitted 9 months ago by bugsmith to c/golang
33
34
 
 

Sometime around the middle of January, I stumbled across One Billion Rows Challenge. I had a lot of fun working on this. I started with an execution time of > 6min and finished at about 14s. Here’s how I went about it.

35
36
37
 
 

I've seen that a new "range-over-func" experiment is available with Go 1.22. In this article, I took a closer look and evaluated the feature for myself.

38
39
 
 

cross-posted from: https://lemmy.world/post/11504334

ServerClip is a tool for copying contents of a file over various ssh connections. Need to get a log file over to your laptop? This can help.

40
4
submitted 9 months ago by mac to c/golang
41
 
 

Hello Lemmy,

invidtui is a TUI-based Invidious client, which can:

  • Search for and browse videos, playlists and channels
  • Play audio or video from any instance
  • View, open, edit and save m3u8 playlists
  • Download video/audio in any format
  • Authenticate with the preferred instance, and show user feed, playlists and subscriptions

This release contains the following new features/fixes:


Dynamic theming

Themes can now be applied from theme files dynamically within the application as well as from command-line and configuration options.

A demo and instructions are posted here


Channel 'Releases' tab

A new 'releases' tab is added to the channel page, to show new content from channel authors.


Enhanced configuration handling

Configuration handling is now done in the most cross-platform way as possible.


I hope you enjoy this release, and any feedback is appreciated.

42
12
submitted 10 months ago by Toda to c/golang
43
44
 
 

I am doing a lot of work right now that requires day and year durations and I have to define those myself. I wonder why they didn't include those in the time package.

45
10
Coming Soon: Golang 1.22 (www.dolthub.com)
submitted 10 months ago by mac to c/golang
46
11
submitted 10 months ago by mac to c/golang
47
10
submitted 10 months ago by mac to c/golang
48
35
Go: What We Got Right, What We Got Wrong (commandcenter.blogspot.com)
submitted 10 months ago by austin to c/golang
49
 
 

Repo: https://git.code.netlandish.com/~petersanchez/gohome

I wrote a simple application to easily manage your Go modules that you host on your own domains, backed by sqlite3.

I know there are quite a few ways to do this (nginx hacks, static pages, other server apps) but none of them scratched my itch. I wanted a simple utility that I can add/edit via my web browser and be done with it. No config file changes, no server reloads, etc.

Happy to hear all feedback.

Blog post (if you care): https://petersanchez.com/easily-host-go-modules-on-your-domain/

50
 
 

Based on the Go 1.22 release notes from the Go team (3-Clause BSD License), with many interactive examples added. This blog post is synchronized with the source document as it gets updated.

view more: ‹ prev next ›