Tag go
59 bookmarks have this tag.
59 bookmarks have this tag.
DevCrowd вместе с Авито провели исследование рынка Go-разработчиков, 2024
Nice dashboard hm.
yarr (yet another rss reader) is a web-based feed aggregator which can be used both
as a desktop application and a personal self-hosted server.The app is a single binary with an embedded database (SQLite).
A good snippet. I used it at work.
func track(name string) func() {
start := time.Now()
return func() {
log.Printf("%s, execution time %s\n", name, time.Since(start))
}
}
func main() {
defer track("main")() // do not forget about the second parentheses
time.Sleep(2 * time.Second)
}
Something like make
, but magefiles are written in Go instead. Pretty funny.
Embeds all resources (e.g. CSS, image, JavaScript, etc) producing a single HTML5 document that is easy to store and share.
In case the submitted URL is not HTML (for example a PDF page), Obelisk will still save it as it is.
Downloading each assets are done concurrently, which make the archival process for a web page is quite fast.
Accepts cookies, useful for pages that need login or article behind paywall.
Might actually be a good choice for Betula archival. Might need to fork it, though.
The mighty, self-hostable Git server for the command line
Capslock is a capability analysis CLI for Go packages that informs users of which privileged operations a given package can access. This works by classifying the capabilities of Go packages by following transitive calls to privileged standard library operations.
The recent increase in supply chain attacks targeting open source software has highlighted that third party dependencies should not be inherently trusted. Capabilities indicate what permissions a package has access to, and can be used in conjunction with other security signals to indicate which code requires additional scrutiny before it can be considered trusted.
Staticcheck - The advanced Go linter. Contribute to dominikh/go-tools development by creating an account on GitHub.
Anvil is a graphical, multi-pane tiling editor that makes bold use of the mouse and integrates closely with the shell. It supports syntax highlighting, multiple cursors and selections, remote file editing, and contains a powerful text manipulation language.
package main templ Hello(name string){ <div>Hello, { name }</div> } templ Greeting(person Person){ <div class="greeting"> @Hello(person.Name) </div> }
Вики на микоризе с ссылками про го.
Alternative Go (Golang) Playground with syntax highlighting, turtle graphics and more
In Go, a string is a (possibly empty) immutable sequence of bytes. The critical word here for our purposes is immutable. Because byte slices are mutable, converting between string and []byte generally requires an alloc and copy, which is expensive.
What if such conversions were cached? That would make comparing strings so much faster!: two integer comparisons (len and ptr). This article explains how this approach could be implemented.
A library implementing this:
It looks pretty small and simple. Despite having only 81 stars, it is used by 67.4k GitHub packages. Transitive dependencies. Found it at work accidentally. OpenSource woes.
By wrapping errors and building well-formatted error messages, we can keep better track of where errors are happening. I often just add the name of the function being called to my error messages, but we can make the message say whatever we want. For example, I’ll often include parameter information in the error so I know which inputs caused the error.
There’s no size difference between a string and a
struct{ string }
and it’s just as easy to read as a straight string. Because of theString()
method, you can pass these values to%s
etc in format strings and they’ll print out the name with no extra code or work.
The fish told me of this cool new feature. In short,
func main() {
mux := http.NewServeMux()
mux.HandleFunc("GET /path/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "got path\n")
})
mux.HandleFunc("/task/{id}/", func(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
fmt.Fprintf(w, "handling task with id=%v\n", id)
})
http.ListenAndServe("localhost:8090", mux)
}
Handy!
⚡ Automates terminal operations.
What we learned from our 2023 H2 developer survey
A linter for Go that finds nil panics. It found several potential nil panic in Betula and Mycorrhiza codebases that I didn't bother fixing.
Via Waffle
Tedu wrote a tool that lets you handle errors in Go like this:
func decomp(filename string) ([]byte, error) {
fd := ^os.Open(filename)
defer fd.Close()
zd := ^gzip.NewReader(fd)
data := ^io.ReadAll(zd)
return data, nil
}
Funky!
Author says Go is good because it's stuck in the 70s. Also tells a bit how the 70s were like. Mentions IBM 360, Oberon and whatnot.
The Go standard library is full of bad design choices from the perspective of safety of use.
Gio is an open source library for creating portable, immediate mode GUI programs for Android, iOS, Linux, Windows, macOS.
This module provides go bindings for sqlean. It is compatible with the popular mattn/go-sqlite3 driver.
How Go is kept boring. And they canceled Go 2.
Lightweight Golang ORM for PostgreSQL, MySQL, MSSQL, and SQLite
Parses HTML responses and rewrites a simplified light weight version.
Rewrite rules are written in lua using standard CSS selectors.
A Mercurial forge. Has a powerful vibe. Supports fo get.
Goroutines are not coroutines! I thought it was a nice pun! It's not!
Russ walks us over the concept of coroutines in other languages and then implements them in Go using goroutines.
Gotta read more thoroughly. I don't really see why we need them.
P. S. Loving how coroutine is shortened to coro. It's how the Francophones shorten laboratorie or whatever to just labo. Adolescent becomes ado. Cool French style!
1994. The language is nicely designed. Nice to see the original goroutines here, as this is a Go predecessor. The rodent theme is old, as it seems. The mice in the title are the computer mice.
Oh, that's how I should refactor Mycomarkup. Perfect.
Антон Жиянов рекламирует свой новый реестр. Там показано, как расширение в Го подключить, может пригодиться потом.
Open source avatar generator inspired by GitHub avatars. - rrivera/identicon: Open source avatar generator inspired by GitHub avatars.
Go Go!
This person develops tools for the Fediverse in Go.
Go bindings to the Lemmy API, automatically generated directly from Lemmy's source code using the generator in cmd/gen.
Go is not an easy programming language. It is simple in many ways: the syntax is simple, most of the semantics are simple. But a language is more than just syntax; it’s about doing useful stuff. And doing useful stuff is not always easy in Go.
XahLee сказал:
the best languages to learn today for the next 20 year are: golang, PowerShell, Mathematica.
Про голянг понятно. Про остальное:
PowerShell or the pwsh, is far better shell than bash and unix bag friends.
Mathematica, is the programing language far beyond any other in the computing industry. A magnitude beyond all existing. It is more than a programing language, because it is really a computational knowledge base. Asides from math functions, such as solving equations or integration symbolically and hundreds other special math functions only a handful mathematician understands, it also embodies just about every practical algorithm in computer science. So, given a algorithm, you might write it in lang X for a hour or days, but Mathematica has it as part of the language, just call a function. Mathematica has few thousand functions builtin, not even needing to load a library.
🍄: Мне нравится, когда люди хорошо говорят о Мафематике. Мне она тоже нравится. Хочу как-нибудь лицензию получить... Говорят, с малиной π в комплекте идёт 🤔
A curated list of articles complaining that go (golang) isn't good enough
Not maintained since 2017. Nevertheless, the list is huge!
I get the impression that a map can only hold 64 values from this text, but this is not true. How does it work?
A wonderful read
TL;DR* It feels boring, it feels old, and as a consequence overly laborious. As a general purpose language, I feel D does the job a lot better.
The author applies the belts from martial arts to Go knowledge. I have the green one.
The author applies the Zen of Python to Go and tells us how Go programs should be written. This is a well-written article.
Perhaps the matter I most appreciate Go for is its long-term commitment to simplicity, stability, and robustness. I prize these traits more strongly than any other object of software design. The Go team works with an ethos of careful restraint, with each feature given deliberate consideration towards identifying the simplest and most complete solution, and they carefully constrain the scope of their implementations to closely fit those solutions. The areas where Go has failed in this regard are frightfully scarce.
Gophernotes is a Go kernel for Jupyter notebooks and nteract. It lets you use Go interactively in a browser-based notebook or desktop app. Use gophernotes to create and share documents that contain live Go code, equations, visualizations and explanatory text. These notebooks, with the live Go code, can then be shared with others via email, Dropbox, GitHub and the Jupyter Notebook Viewer. Go forth and do data science, or anything else interesting, with Go notebooks!
SQLite is a wonderful piece of software and it is completely meaningful to use it in a project written in Go even though SQLite itself is in C. Though people has been hitting lots of issues with it, mostly "database is locked" error that seems to appear out of nowhere.
First of all, SQLite allows concurrent readers but only a single writer. Unlike most places where you may encounter some sort of synchronization SQLite does not wait for the write lock to become available - instead it just returns an error, letting the caller deal with it. This is why you are getting "database is locked" errors.
Ebiten (/ebíteɴ/) is an open source game library for the Go programming language. Ebiten's simple API allows you to quickly and easily develop 2D games that can be deployed across multiple platforms.
And do I need to explain how bad it looks to have GitHub support baked right into your toolchain in 2020? We tried to warn you, folks.
Go creates static binaries by default unless you use cgo to call C code, in which case it will create a dynamically linked binary. Using cgo is more common than many people assume as the os/user and net packages use cgo, so importing either (directly or indirectly) will result in a dynamic binary.