Golang
- Creating a more sustainable model for oapi-codegen in the futurewww.jvt.me Creating a more sustainable model for `oapi-codegen` in the future · Jamie Tanna | Software Engineer
Announcing a request for sponsorship to continue to allow allocating more time to `oapi-codegen` as well as to make more ambitious changes to the project.
- Evolving the Go Standard Library with math/rand/v2go.dev Evolving the Go Standard Library with math/rand/v2 - The Go Programming Language
Go 1.23 adds math/rand/v2 and charts a course for the evolution of the Go standard library.
- Go Developer Survey 2024 H1 Resultsgo.dev Go Developer Survey 2024 H1 Results - The Go Programming Language
What we learned from our 2024 H1 developer survey
- GoLand 2024.1 is out! With a free locally run AI full line completion, performance improvements, and some neat UX improvements. Check it out!blog.jetbrains.com GoLand 2024.1 Is Out! | The GoLand Blog
GoLand 2024.1 is out and comes with exciting new features like full line code completion for Go, a performance boost for indexing and code highlighting, major updates to remote development and dev con
- Go 1.22.2 released
> > > 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. > >
- Rook, a secret service backed by Keepass 4.x kdbx
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.
- What even is “Dependency Injection”? (a practical example using Go)medium.com What even is “Dependency Injection”? (using Go)
It’s simpler than it sounds. See what it looks like and understand how simple it can really be.
- The Go 'range over functions' proposal and user-written container types
https://utcc.utoronto.ca/~cks/space/blog/programming/GoRangefuncAndUserContainers
- One Billion Rows Challenge in Golangwww.bytesizego.com One Billion Rows Challenge in Golang
The One Billion Row Challenge (1BRC) is intended to be a fun exploration of how far modern Java can be pushed for aggregating one billion rows from a text file. ..But what happens if you do it in Go?
> 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.
- How I write HTTP services in Go after 13 yearsgrafana.com How I write HTTP services in Go after 13 years | Grafana Labs
Mat Ryer, principal engineer at Grafana Labs and host of the Go Time podcast, shares what he's learned from more than a dozen years of writing HTTP services in Go.
- Routing Enhancements for Go 1.22go.dev Routing Enhancements for Go 1.22 - The Go Programming Language
Go 1.22's additions to patterns for HTTP routes.
- Questioning Go's range-over-func Proposal
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.
- ServerClip - Tool for copying contents of a file over various ssh connections.github.com GitHub - ssebs/ServerClip: Tool for copying contents of a file over various ssh connections. Need to get a log file over to your laptop? This can help.
Tool for copying contents of a file over various ssh connections. Need to get a log file over to your laptop? This can help. - GitHub - ssebs/ServerClip: Tool for copying contents of a file over va...
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.
- What’s New in Go 1.22: slices.Concatblog.carlana.net What’s New in Go 1.22: slices.Concat
We’re up to the second release candidate for Go 1.22, which should be released quite soon. In my last blog post, I wrote about my work on reflect.TypeFor for Go 1.22. This time, I’ll be writing about how I proposed and implemented slices.Concat.
- invidtui - An opensource cross-platform Invidious client v0.3.8 is released
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.
- Why Go is my favorite programming languagemichael.stapelberg.ch Why Go is my favorite programming language
I strive to respect everybody’s personal preferences, so I usually steer clear of debates about which is the best programming language, text editor or operating system. However, recently I was asked a couple of times why I like and use a lot of Go, so here is a coherent article to fill in the blanks...
- Share your feedback about developing with Gogo.dev Share your feedback about developing with Go - The Go Programming Language
Help shape the future of Go by sharing your thoughts via the Go Developer Survey
- Why does the time package only define durations up to Hour?
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.
- Coming Soon: Golang 1.22www.dolthub.com Coming Soon: Golang 1.22 🚀
Go 1.22 is expected to be released next month; in this blog post, we dig into the latest release candidate and explore what's new
- What’s New in Go 1.22: reflect.TypeForblog.carlana.net What’s New in Go 1.22: reflect.TypeFor
The backstory on a new function in the reflect package of Go 1.22.
- Go: What We Got Right, What We Got Wrongcommandcenter.blogspot.com What We Got Right, What We Got Wrong
This is my closing talk ( video ) from the GopherConAU conference in Sydney, given November 10, 2023, the 14th anniversary of Go being lau...
- GoHome: A simple app to host your Go modules with vanity URLs
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/
- Go 1.22: Interactive release notesantonz.org Go 1.22: Interactive release notes
Isolated loop variables, range over integers, math/rand v2 and enhanced routing.
> 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.
- Feedback for my first project: reimplement pulp-manifest in go
Hi 👋
I have tried to learn some go but I am still very much at the beginning, like understanding how to work with variables and functions. My background is mostly in python but I am not a programmer by trade.
```` package main
import ( "crypto/sha256" "fmt" "io" "log" "os" "path/filepath" )
func write_lines_to_file(lines []string, output_file string) { f, err2 := os.Create(output_file) if err2 != nil { log.Fatal(err2) } defer f.Close() for _, line := range lines { _, err := f.WriteString(line + "\n") if err != nil { log.Fatal(err2) } } }
func get_size_and_hash(file_path string) (int, string) { file, err := os.Open(file_path) if err != nil { panic(err) } defer file.Close() hash := sha256.New() if _, err := io.Copy(hash, file); err != nil { panic(err) } sum := fmt.Sprintf("%x", hash.Sum(nil)) file, err2 := os.Open(file_path) if err2 != nil { log.Fatal(err2) } fi, err2 := file.Stat() if err != nil { log.Fatal(err2) } my_size := fi.Size() return int(my_size), string(sum) }
func get_list_of_files(target_directory string) []string { var files []string err := filepath.Walk(target_directory, func(path string, info os.FileInfo, err error) error { if err != nil { fmt.Println(err) return nil } if !info.IsDir() { files = append(files, path) } return nil }) if err != nil { log.Fatal(err) } return files }
func main() { // accept directory as user input target_directory := os.Args[1]
my_files := get_list_of_files(target_directory)
var content []string
for _, file := range my_files { size, hash := get_size_and_hash(file) var str_file string = string(file) str_size := fmt.Sprint(size) var str_hash string = string(hash) // structure: file, checksum, size combined_line := str_file + "," + str_hash + "," + str_size content = append(content, combined_line) }
var output_file string = target_directory + "/PULP_MANIFEST" write_lines_to_file(content, output_file) } ````
I am testing this using the following command:
rm -f test_input/PULP_MANIFEST && go fmt pulp_manifest.go && go build pulp_manifest.go && ./pulp_manifest test_input && cat test_input/PULP_MANIFEST
on Fedora with go 1.20Known Limitations
- My rewrite does not handle files or directories with "," yet.
Untested
- Files with binary content
- Paths on macOS or Microsoft Windows
- Paths with whitespace
- Symlinks in target_directory
- target_directory as symlink
I am looking for the following feedback:
- bugs and limitations
- a was to add tests: do you have any recommendations for talks or blog posts?
- style & best practice
- a way to use static typing?!
- anything else that you would recommend a novice.
Right now, I believe my rewrite works. Feel free to shatter my assumption. Cheers.
- Optimizing Go string operations with practical examplesmedium.com Optimizing Go string operations with practical examples
I’m going to show you how I took a very simple program and made it run almost 5 times faster, with very minimal adjustments. You may know…
Not OC
- Go Developer Survey 2023 H2 Resultsgo.dev Go Developer Survey 2023 H2 Results - The Go Programming Language
What we learned from our 2023 H2 developer survey
- Error return traces for Go, inspired by Ziggithub.com GitHub - bracesdev/errtrace: An alternative to stack traces for your Go errors
An alternative to stack traces for your Go errors. Contribute to bracesdev/errtrace development by creating an account on GitHub.
- Making Games in Go for Absolute Beginnersthreedots.tech Making Games in Go for Absolute Beginners
Here’s a rant I often see in developer communities: I used to love programming because I like building stuff. But my full-time job killed my passion. I spend more time in meetings, fighting over deadlines, and arguing in reviews than working with code. Am I burned out? Is there hope, or do I need a...
- Python is Easy. Go is Simple. Simple != Easy.preslav.me Python is Easy. Go is Simple. Simple != Easy.
Python and Go have distinct qualities that can complement each other.
- GitHub - golang-standards/project-layout: Standard Go Project Layoutgithub.com GitHub - golang-standards/project-layout: Standard Go Project Layout
Standard Go Project Layout. Contribute to golang-standards/project-layout development by creating an account on GitHub.
- I wrote a pong clone in Golang with Raylib
cross-posted from: https://programming.dev/post/6378161
> cross-posted from: https://programming.dev/post/6378158 > > > Hey guys, I made pong clone in Golang with Raylib. Was wondering what you all thought about it.
- NilAway: Practical Nil Panic Detection
Open source with a repo for it at https://github.com/uber-go/nilaway/