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
101
 
 

Waiting for go1.21: Execution Tracing with < 1% Overhead

Learn about the upcoming go1.21 performance improvements that reduce the overhead of execution tracing from up to 20% to less than 1% for most applications.

102
103
 
 

Understanding Go 1.21 generics type inference

Breaking down the release notes, with concrete explanations and annotated examples

104
20
submitted 1 year ago by austin to c/golang
105
 
 

Definitely had some trouble parsing and understanding the meanings of the improvement list, though.

106
10
Iterators in Go (self.golang)
submitted 1 year ago by nebiros to c/golang
 
 

Iterators in Go

This article describes a proposed extension to the Go language: range over func. The proposal is evolving, and this tutorial is a work in progress, so don’t forget to check back later for the latest developments.

107
108
109
 
 

Now this right here, is one sexy looking shell! 😍 :bash:

That feeling you get when you're API server spins up and only logs the good messages to STDOUT...it makes me feel all warm and fuzzy 🙃

Oh, and I totally went with #golang for my server... @golang is one of my true loves, what can I say?! I'd be remiss to not say that @NixOS is moving on up my list too 😉 🤘 #server #programming #nixos

110
111
 
 

Hello Lemmy,

InvidTUI is a cross platform Invidious client, which can:

  • Browse, play and download YouTube audio and video
  • Create, save and open m3u8 playlists
  • Interactively switch between instances
  • Change video and album art resolutions
  • View and manage user feed, playlists and subscriptions

Among many other features.

In addition to the above, it also has a menu system, so that users need not remember all the keybindings, and instead select the required option from the menu to perform the desired operation.

This release contains the following new features:

  • A HJSON based configuration format, where you can define custom keybindings as well
  • Faster JSON parsing, thanks to jsoniter
  • Create new folders and rename items within the filebrowser
  • Automatically or manually configure the download directory from within the application
  • Change thumbnail quality

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

112
 
 

The Go programming language has released its first Release Candidate (RC) for version 1.21, which is packed with new features, improvements, and performance enhancements. This article provides an overview of the notable changes and features in Go 1.21, along with some exciting additions to the standard library.

  • PGO
  • min, max functions
  • preview of loop capture change
  • new slog, slices, and map packages
  • WASI port
113
 
 

Today we published gonew, an experimental tool for instantiating new projects in Go from predefined templates.

$ go install golang.org/x/tools/cmd/gonew@latest

114
115
 
 

A few years ago I wrote pygit, a small Python program that’s just enough of a Git client to create a repository, add some commits, and push itself to GitHub.

I wanted to compare what it would look like in Go, to see if it was reasonable to write small scripts in Go – quick ’n’ dirty code where performance isn’t a big deal, and stack traces are all you need for error handling.

The result is gogit, a 400-line Go program that can initialise a repository, commit, and push to GitHub. It’s written in ordinary Go … except for error handling, which is just too verbose in idiomatic Go to work well for scripting (more on that below).

116
117
118
119
10
The adapter pattern in Go (bitfieldconsulting.com)
submitted 1 year ago by nebiros to c/golang
120
 
 

Our current inlining policy remains built on a foundation that is becoming increasingly strained as we add things like PGO, is increasingly anchored in past backend limitations, and it continues to use an overly simplistic cost model driven by an overly simplistic scheduler. Between unified IR and the untapped possibilities of PGO, I believe there’s now a significant opportunity to improve the inlining policy, resulting in significant performance improvements for Go applications, and reducing the effort and expertise needed to write highly efficient Go code.

121
 
 

Go programmers have the good fortune of excellent testing and benchmarking tooling built into the standard library - in the testing package. However, benchmarking is hard. This isn't Go specific; it's just one of those things experienced developers learn over time.

This post lists some common benchmarking pitfalls Go programmers run into. It assumes basic familiarity with writing Go benchmarks; consult the testing package documentation if needed. While these pitfalls are presented in Go, they exist in any programming language or environment, so the lessons learned here are widely applicable.

122
123
124
 
 

hello, noob here, so, i was writing a program in go to edit a image, and for now i use os.Open(file) to select the file, how i wanted to open the file chooser maybe using org.freedesktop.portal.FileChooser for the user to select the file, but i trying searching it and i couldn't find an answer, maybe i was using the wrong keywords, but anyway, i hope some can help me, thank you!

btw, i'm also not familiar with portals, i was hoping that i could learn a bit more how they work

125
5
Set? (mander.xyz)
submitted 1 year ago by [email protected] to c/golang
 
 

Generics have been around for a while now, and although this has been brought up before, do ya'll think a built in set data type like golang-set (or something similar) will come to the stdlib? Do you think it should?

I think it would be a great convenience at little to no cost to the practicalities or philosophies of Go.

view more: ‹ prev next ›