Golang
-
From @palkan: Learn how to temporarily stream verbose logs from your applications without restarts and even without changing the application-level logging settings.
-
oapi-codegen release v2.2.0: Pure-Go 1.22+ server, documentation overhaul. JSON schema and several bug fixes
github.com Release v2.2.0: Pure-Go 1.22+ server, documentation overhaul. JSON schema and several bug fixes · deepmap/oapi-codegenBig announcements In case you've missed it, we've got a few big announcements as maintainers of oapi-codegen which we'd recommend you read in more depth. oapi-codegen is moving to its own org Th...
-
We're looking for GoLang Contributors
cross-posted from: https://discuss.online/post/8349829
> Hello, > > We're looking for GoLang contributors to help with the federation service. We're happy to have people that contribute code or help with code reviews. > > If you know anyone or if you're interested please reach out! > > Email: [email protected] > Mastodon: https://utter.online/@sublinks > Online form: https://sublinks.org/join_organization.html > > Thanks, > jgrim
-
Social media image generator
github.com GitHub - adhd42/oxigen: Social media image generatorSocial media image generator. Contribute to adhd42/oxigen development by creating an account on GitHub.
-
Beginner resources?
After asking for a first programming language here, I've decided learning Go. After some searching I've found that the beginner learning resources are some years old. Can anyone suggest some beginner resources for someone that likes to learn by doing stuff? Thank you.
-
Creating a more sustainable model for oapi-codegen in the future
www.jvt.me Creating a more sustainable model for `oapi-codegen` in the future · Jamie Tanna | Software EngineerAnnouncing 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/v2
go.dev Evolving the Go Standard Library with math/rand/v2 - The Go Programming LanguageGo 1.23 adds math/rand/v2 and charts a course for the evolution of the Go standard library.
-
Go Developer Survey 2024 H1 Results
go.dev Go Developer Survey 2024 H1 Results - The Go Programming LanguageWhat 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 BlogGoLand 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.
-
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 Golang
> 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 years
grafana.com How I write HTTP services in Go after 13 years | Grafana LabsMat 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.22
go.dev Routing Enhancements for Go 1.22 - The Go Programming LanguageGo 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.
- blog.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.
- michael.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 Go
go.dev Share your feedback about developing with Go - The Go Programming LanguageHelp 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.22
www.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
- blog.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 Wrong
commandcenter.blogspot.com What We Got Right, What We Got WrongThis 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/
- antonz.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.
-
Go Developer Survey 2023 H2 Results
go.dev Go Developer Survey 2023 H2 Results - The Go Programming LanguageWhat we learned from our 2023 H2 developer survey
-
Error return traces for Go, inspired by Zig
github.com GitHub - bracesdev/errtrace: An alternative to stack traces for your Go errorsAn alternative to stack traces for your Go errors. Contribute to bracesdev/errtrace development by creating an account on GitHub.