Redox continues adding dynamic linking support
These months are coming and going way too fast, for a whole variety of reasons, so we’ve got another month of improvements for Redox, the operating system written in Rust. I February, January’s work on dynamic linking continued, adding support for it to the recipes for Cargo, LLVM, Rust, libssh2, OpenSSL, zlib, COSMIC Terminal, NetSurf, libpng, bzip2, DevilutionX, and LuaJIT, as well as to the project’s Rust and OpenSSL forks. Relibc also … ⌘ Read more
golang 每日一庫之 go-flags
go-flags 是一個用於處理命令行參數和標誌的 Go 庫,它提供了一種簡潔而靈活的方式來定義和解析命令行標誌(flags)和參數。這個庫對於需要處理命令行輸入的 Go 應用程序非常有用,特別是在構建 CLI(命令行工具)時。1. 安裝 go-flags首先,你需要安裝 go-flags 庫。在命令行中運行以下命令:go get github.com/jessevdk/go-flags這個命令會 ⌘ Read more
在 Go 中如何使用分佈式鎖解決併發問題?
在分佈式系統中,協調多個服務實例之間的共享資源訪問是一個經典的挑戰。傳統的單機鎖(如 sync.Mutex)無法實現跨進程工作,此時就需要用到分佈式鎖了。本文將介紹 Go 語言生態中基於 Redis 實現的分佈式鎖庫 redsync,並探討其使用方法和實現原理。分佈式鎖首先我們來探討下爲什麼需要分佈式鎖?當我們編寫的程序出現資源競爭的時候,就需要使用互斥鎖來保證併發安全。而我們的服務很有可能不會單 ⌘ Read more
Go 1-24 中改進的 Finalizer:介紹 runtime-AddCleanup
Go 1.24 通過 runtime.AddCleanup 引入了一個新的、改進的 Finalizer 機制。這個函數是對 runtime.SetFinalizer 的重大改進,提供了更多的靈活性、更好的效率和改進的安全性。Finalizer 在 Go 中扮演着關鍵角色,當對象不再可達時運行清理函數。這允許開發者自動執行諸如關閉文件、釋放內存和註銷資源等重要任務。今天我們將探討 runtime.A ⌘ Read more
Announcing the Beta Release of OpenTelemetry Go Auto-Instrumentation using eBPF
The OpenTelemetry community is excited to announce the beta release of the OpenTelemetry Go Auto-Instrumentation project! This milestone brings us closer to our mission of making observability simple, accessible, and effective for Go applications. What is… ⌘ Read more
Xid:Go 輕量級 ID 生成器
在分佈式系統中,唯一 ID(GUID)是必不可少的,常見的方案包括 UUID、MongoDB ObjectID 和 Twitter Snowflake。其中 UUID 雖然通用,但長度較長,而 Snowflake 需要額外的機器 / 數據中心配置。xid (github.com/rs/xid) 是一個基於 MongoDB ObjectID 算法的更輕量級、更高效的全局唯一 ID 生成庫,用於生成 ⌘ Read more
golang 每日一庫之 concurrent-map
概述orcaman/concurrent-map/v2 是一個 Go 語言的高性能併發安全哈希表實現。它通過分片鎖(shard locking)策略減少鎖競爭,適用於高併發讀寫場景。與標準庫的 sync.Map 不同,該庫針對通用鍵值類型優化,提供更靈活的 API 和更高性能。項目地址GitHub 倉庫 : https://github.com/orcaman/concurrent- ⌘ Read more
Golang 程序卡死排查指南
我正在幫助某人設置我的 gokrazy/rsync 實現來同步 RPKI 數據(用於保護 BGP 路由基礎設施),當時我們發現,在特定調用方式下,我的 rsync 接收器會無限期掛起。這個問題很快就解決了,但在這個過程中,我意識到我應該記錄下這些年來我所欣賞的一些 Go 調試技巧!場景:Go 程序掛起———-如果你想跟着實驗,可以構建 gokrazy/rsync 的一個較舊版本,就在修 ⌘ Read more
使用 Golang 編寫 2D 遊戲
Ebitengine 是一款基於 Go 語言的 2D 遊戲開發引擎,提供了簡單易用的 API 和跨平臺的支持,開發者可以通過它輕鬆構建遊戲項目。核心特性——-跨平臺支持 Ebitengine 支持多個平臺,包括 Windows、macOS、Linux,以及 WebAssembly(可運行於瀏覽器中)。這使得開發者可以在不同設備上運行同一個遊戲項目,而無需編寫額外的代碼。易用的 API ⌘ Read more
golang 面試題:Goroutinue 什麼時候會被掛起?
今天我們來聊聊一個在 Go 面試中經常遇到的經典問題:Goroutine 什麼時候會被掛起?如果你是一個 Go 程序員,或者正在準備 Go 相關的面試,可能對這個問題有一些疑問。那麼,就讓我從一個資深程序員的角度,帶你們深入淺出地分析這個問題。💡什麼是 Goroutine?首先,咱們得搞清楚什麼是 Goroutine。簡而言之,Goroutine 就是 Go 中的輕量級線程。它讓我們可以用極低的成 ⌘ Read more
@lyse@lyse.isobeef.org Looks like a nice day. 😊 I tried to go on a quick walk, but it was really cold. And everything’s wet at the moment. Bah.
Clothespins in the woods, who would have thunk? 🥴
Name mi cat ! I found this baby outside the house today and I’m going to keep it🥰. In a few hours I will know if it is female or male. ⌘ Read more
Genode OS Framework 25.02 released
The prime feature is the continuation of the multi-monitor topic of the previous release, covering multi-monitor window management and going as far as seamlessly integrating multi-monitor virtual machines (Section Multi-monitor window management and virtual machines). The second and long anticipated feature is the Chromium engine version 112 in combination with Qt 6.6.2, which brings our port of the Falkon web browser on par with the modern web (Section Qt, WebE … ⌘ Read more
@thecanine@twtxt.net I don’t mind the FUTO keyboard either but it is pretty basic. Going to have to try out helio
golang 每日一庫之 gocarina-gocsv
一、爲什麼選擇 gocsv?Go 標準庫 encoding/csv 提供了基礎的 CSV 讀寫能力,但在處理複雜業務時常常需要:手動轉換字符串到具體類型 維護列索引與結構字段的映射關係 處理嵌套結構等複雜數據類型 處理可選字段和默認值 gocarina/gocsv 通過結構體標籤實現了聲明式的 CSV 解析,極大簡化了開發流程。最新統計顯示,該庫在 GitHub 已獲得 1 ⌘ Read more
Go 語言 errgroup 庫:強大的併發控制工具
errgroup 是官方 Go 庫 x 中的一個實用工具,用於併發執行多個 goroutine 並處理錯誤。它基於 sync.WaitGroup 實現了 errgroup.Group,爲併發編程提供了更強大的功能。errgroup 的優勢————與 sync.WaitGroup 相比,errgroup.Group 具有以下優勢:錯誤處理:sync.WaitGroup 只負責等待 g ⌘ Read more
My little girl. 14 years old. She still hates when I have to go to work. Purring like a diesel engine and cuddling, saying “don’t leave”. ⌘ Read more
Alibaba, Datadog, and Quesma Join Forces on Go Compile-Time Instrumentation
Standards are only useful if they’re widely adopted, and adoption is only effective if the available tooling facilitates it. I imagine SI units would not have been too popular when they were introduced if you had to build… ⌘ Read more
To me it appeared that the failed attempts to ban NPD in the past actually helped them gain more supporters.
What makes AfD stronger for sure is just going “lol nah we’re not even going to try”:
https://www.tagesschau.de/inland/innenpolitik/afd-verbot-antrag-100.html
If they don’t try, then it means that “it can’t be that bad, it’s just a normal party”, right? 😡
context-Context - 構建高可用的 Go 應用
你是否有遇到過這樣的情況:意外的流量激增導致數據庫掛起 系統掛掉,用戶無法訪問 做爲開發人員,你忙於調試問題,事後還會被扣除績效和獎金 不受控制的 goroutines,長時間運行的任務,無響應的 API 這些都會對構建一個高可用的應用造成嚴重影響。這些問題通常源於缺乏適當的上下文管理。無論您是在處理 API 請求、管理數據庫操作,還是構建分佈式系統,掌握上下文都是每個 Go ⌘ Read more
Mozilla is going to collect a lot more data from Firefox users
I guess my praise for Mozilla’s and Firefox’ continued support for Manifest v2 had to be balanced out by Mozilla doing something stupid. Mozilla just published Terms of Use for Firefox for the first time, as well as an updated Privacy Notice, that come into effect immediately and include some questionable terms. The Terms of Use state: When you upload or input information through Firefox, you hereby grant u … ⌘ Read more
MCP 實戰:使用 Go 快速構建 MCP Server
MCP 簡介MCP 協議(Model Context Protocol,模型上下文協議)是由 Anthropic 於 2024 年 11 月底推出的一種開放標準,旨在統一大型語言模型(LLM)與外部數據源和工具之間的通信。官方地址 https://modelcontextprotocol.io 架構如下 MCP 協議的架構包含多個關鍵組件:Host(宿主程序)、MCP Client(M ⌘ Read more
Go 1-24 新特性:標準庫 os-Root 解析
背景 ——–Go 1.24 已進 release,其版本說明 [1] 中包含了多項新特性。本文將重點解析新增的標準庫 os.Root 功能,它能有效防禦目錄遍歷漏洞(Directory Traversal Vulnerabilities)。目錄遍歷漏洞是典型的安全問題,攻擊者通過提供相對路徑(如 ../../../etc/passwd)誘導程序訪問非授權文件。近期真實案例 CVE- ⌘ Read more
Mozilla reaffirms it won’t remove Manifest v2 support from Firefox
Mozilla has officially reiterated that it’s going to keep offering support for both Manifest v2 and Manifest v3 extensions in Firefox. Google is removing support for Manifest v2 from Chrome, and with it a feature called blockingWebRequest that is used by ad blockers like uBlock Origin. Google’s replacement for that feature is more restrictive and less capable, and as such, uBlock Origin no longer wor … ⌘ Read more
I’m going to bed. I left them a 1 Star rating and full Review on Google Maps 🤣
I’m going to bed. I left them a 1 Star rating and full Review on Google Maps 🤣 ⌘ Read more
The big established parties are all bad traitors. I blame them and their actions to help raise AfD. They just [don’t?] give a fuck about the ordinary people, they’re only concerned about their private gain and power.
To a large degree, yes. But I think the media is also equally at fault. There was absolutely no reason to invite AfD people to every event and let them talk. This has been going on for over 10 years. When we give them a stage to spread their hate, are we really surprised that hate spreads … ?
I don’t know the answers to this desaster. I’m beginning to think that people literally just want an outlet for their frustration, nothing more. It’s not about what particular parties actually plan to do. At least I think this applies to people in their 30ies and 40ies.
Go 項目目錄結構指南
擁有一個井然有序的目錄結構非常重要,原因有幾個:層次分離:它將項目的不同部分——如業務邏輯、數據訪問和 API 處理——放在各自的文件夾中。這樣,開發人員可以專注於特定領域,而不會感到不知所措或困惑。 更好的組織: 通過整齊地整理你的代碼及其依賴項,較大的項目變得更容易導航。你總是知道在哪裏找到你需要的東西! 可重用性: 一個良好的結構讓你可以創建可以在項目不同部分使用的組件或包,從而 ⌘ Read more
golang 每日一庫 samber-lo
samber/lo 是一個非常流行的 Go 語言庫,它提供了一些常用的函數式編程風格的工具函數,使得 Go 代碼更加簡潔、優雅。該庫的設計理念是減少代碼冗餘,簡化開發過程,尤其是在處理常見的數據結構和算法時。lo 這個庫的名字來源於 “Lazily Optimized” 的縮寫,但它本身並不涉及延遲計算或優化策略。它的目標是提供一系列常見操作的簡便方法,尤其是集合類型(如切片、映射、通道等)的操作 ⌘ Read more
And, Ramadan is next week. So, we switched to UTC from UTC+1 in the weekend. As if it’s going to make the days any shorter 😅
Go 語言之在 Gin 框架中使用 Zap 實現高效日誌管理
在現代 Web 開發中,日誌管理是確保應用程序性能、穩定性和可維護性的關鍵因素之一。Gin 作爲輕量級的 Go Web 框架,自帶了簡單的日誌功能。然而,對於追求高性能和靈活性的開發者來說,Zap 日誌庫是一個理想的選擇。本文將深入探討如何在 Gin 框架中集成 Zap 日誌庫,實現高效、分級和結構化的日誌記錄。本文介紹瞭如何在 Go 的 Gin 框架中使用 Zap 日誌庫替換默認日誌功能,提供更 ⌘ Read more
golang 每日一庫之 pressly-goose
pressly/goose 是一個用於 Go 語言的數據庫遷移工具。它提供了一種簡單且高效的方式來管理數據庫 schema 的版本控制,適用於數據庫結構變更的管理和遷移。goose 的設計目標是讓數據庫遷移更加簡便、安全,並且在多環境下可以輕鬆應用。數據庫遷移通常用於在應用程序中管理數據模式的變化(例如添加表、修改列、刪除索引等),尤其在團隊協作開發、生產環境發佈等情境下,遷移工具幫助開發者和運維 ⌘ Read more
golang 每日一庫之 iancoleman-orderedmap
github.com/iancoleman/orderedmap 是一個 Go 語言庫,提供了一個有序字典(OrderedMap)實現,區別於 Go 語言內建的 map 類型,內建的 map 是無序的。該庫的 OrderedMap 能夠保持元素的插入順序,因此適用於需要按插入順序遍歷元素的場景。主要特點:有序性:OrderedMap 保證元素的插入順序,和內建的 map 類型不同, ⌘ Read more
Go 編程實踐 - Go Context
1、context 包的引入context 包是在 Go 1.7 引入的,它爲在多個 goroutine 之間傳遞請求範圍的上下文信息和控制 goroutine 的生命週期提供了一種標準的方式。2、context 包的主要作用傳遞上下文信息:context 可用於在 goroutine 之間傳遞請求範圍的數據,如請求的認證信息、請求的截止時間、請求的 ID 等。這些信息在 goroutine 之間 ⌘ Read more
golang 每日一庫之 swaggo
Go Swagger(Swaggo)是一個用於 Go 語言的開源工具集,它幫助開發者自動生成 API 文檔。它利用 Go 的註釋和結構體信息,通過解析代碼,生成符合 OpenAPI 規範的文檔。OpenAPI(也稱爲 Swagger)是一個廣泛使用的 API 規範,它使得 API 文檔更加標準化、易於理解和交互。Swaggo 主要的功能包括:1. 自動生成 OpenAPI 文檔Swaggo 通過解 ⌘ Read more
Go 事件驅動架構:從原理到實戰,徹底掌握高併發編程
在 Go 語言的世界裏,如何優雅地處理海量併發請求?事件驅動架構(Event-Driven Architecture, EDA)或許是你需要的答案。 🔥 爲什麼你需要關注事件驅動架構? ———————-在傳統的同步編程模式下,我們通常採用阻塞調用的方式來處理請求。然而,在高併發、高吞吐的場景下,這種方式可能帶來以下問題:線程資源浪費:大量 Goroutine 在 I ⌘ Read more
Creating an API with authentication using Encore.go
1 points posted by Elton Minetto ⌘ Read more
@bender@twtxt.net @prologic@twtxt.net The outcome was to be expected but it’s still pretty catastrophic. Here’s an overview:

East Germany is dominated by AfD. Bavaria is dominated by CSU (it’s always been that way, but this is still a conservative/right party). Black is CDU, the other conservative/right party.
The guy who’s probably going to be chancellor recently insulted the millions of people who did demonstrations for peace/anti-right. “Idiots”, “they’re nuts”, stuff like that. This was before the election. He already earned the nickname “Mini Trump”.
Both the right and the left got more votes this time, but the left only gained 3.87 percentage points while the right (CDU/CSU + AfD) gained 14.72:

The Green party lost, SPD (“mid-left”) lost massively (worst result in their history). FDP also lost. These three were the previous government.
This isn’t looking good at all, especially when you think about what’s going to happen in the next 4 years. What will CDU (the winner) do? Will they be able to “turn the ship around”? Highly unlikely. They are responsible for the current situation (in large parts). They will continue to do business as usual. They will do anything but help poor/ordinary people. This means that AfD will only get stronger over the next 4 years.
Our only hope would be to ban AfD altogether. So far, nobody but non-profit organizations is willing to do that (for unknown reasons).
I don’t even know if banning the AfD would help (but it’s probably our best/only option). AfD politicians are nothing but spiteful, hateful, angry, similar to Trump/MAGA. If you’ve seen these people talk and still vote for them, then you must be absolutely filled with rage and hatred. Very concerning.
Correct me if I’m wrong, @lyse@lyse.isobeef.org, @arne@uplegger.eu, @johanbove@johanbove.info.
使用 Go Convey 做 BDD 測試的入門指南
前面在「Go 代碼測試時怎麼打樁?給大家寫了幾個常用案例」中我們介紹了在單元測試中使用gomonkey爲代碼進行打樁的各種方法。今天我們介紹在 Go 單元測試中另外一個很好用的工具庫goconvey,上面說的gomonkey屬於在 Test Double 方面提供能力,也就是我們通常說的mock,用它們可以自定義一套實現來替換項目中的代碼實現。而goconvey則是一個幫助我們組織和管理測試用例的 ⌘ Read more
@andros@twtxt.andros.dev yeah, sorry I couldn’t get back to you sooner. I’ve already made an account on codeberg in order to file in an issue but, I just can’t get myself to concentrate with everything going on with the family lately. I’ll do my best and get things done properly and soon
Microsoft is paywalling features in Notepad and Paint
There’s some bad news for Windows users who want to use all of the built-in features of the operating system and its integrated apps. Going forward, Microsoft is restricting features in two iconic apps, which you’ll need to unlock with a paid subscription. The two apps in question? Notepad and Paint. Windows Insiders were previously able to use these app features free of charge. However, Microsoft is now making it necessary … ⌘ Read more
Retry-Go:Go 優雅重試
在 Go 語言的開發過程中,我們經常需要執行可能失敗的操作,比如網絡請求。如果每次失敗都直接報錯並終止程序,用戶體驗就會很差。通常的做法是重試,即在失敗後等待一段時間再嘗試重新執行。retry-go (github.com/avast/retry-go) 是一個輕量級的 Go 語言重試庫,提供簡單易用的「重試機制」,支持:自定義重試策略(固定間隔、指數回退、隨機回退)。 最大重試次數(避免無 ⌘ Read more
HTTP-2 工作原理與 Go 實戰
在瞭解了上一篇文章的 net/rpc 內容(從 Go 應用中的 net/rpc 到 gRPC)後,現在是時候深入瞭解 HTTP/2 了,它是 gRPC 協議的基礎。HTTP/2 原理及 Go 實戰指南本文偏重理論講解,內容會比較密集。我們主要聚焦 HTTP/2 的核心概念,之後簡要介紹如何在 Go 中啓用它。建議泡杯咖啡,坐下來慢慢看,讓我們一步步拆解這個話題。HTTP/2 優勢——— ⌘ Read more
@prologic@twtxt.net I wish getting a static IP and a (more) stable internet connection wasn’t so hard over here. Then I could do proper self-hosting as well. But as it stands, I need some rented VPS.
I could go ahead and just use the VPS for the IP, i.e. forward all traffic through Wireguard to a box here at home. Big downside is that the network connection would be even slower than it already is and my ISP breaks down all the time for a few minutes … it’s just bad overall and much easier/better to rent a VPS. 🫤
使用 Go 構建可擴展的 WebAssembly 應用
Go 1.24 通過新增 go:wasmexport 指令和構建 WASI 反應器(Reactor)的能力,顯著增強了其 WebAssembly(Wasm)支持。這些特性使開發者能夠將 Go 函數導出到 Wasm 模塊,實現與 Wasm 主機的深度集成,拓展了 Go 在 Wasm 應用開發中的可能性。WebAssembly 與 WebAssembly 系統接口(WASI)————- ⌘ Read more
golang 每日一庫之 govalidator
govalidator 是一個用 Go 語言編寫的輕量級的驗證庫,提供了豐富的驗證和清理功能,主要用於驗證和清理用戶輸入的數據(如表單數據、API 請求的 JSON 數據等)。它支持常見的數據驗證功能,如電子郵件、URL、IP 地址、信用卡號等的驗證,同時也支持自定義驗證規則。1. 安裝你可以通過 go get 來安裝 govalidator:go get github.com/asaskevic ⌘ Read more
Datatypes:Go 輕鬆支持數據庫 JSON 類型
GORM 是 Go 語言中最流行的 ORM 之一,它簡化了數據庫操作,提升了開發效率。然而,在某些情況下,標準的數據類型無法滿足複雜業務需求。例如,如何將 Go 中的結構體、切片、JSON 等類型映射到數據庫字段?如何方便地進行序列化和反序列化?爲了解決這些問題,GORM 提供了 datatypes (gorm.io/datatypes) 擴展庫,旨在簡化 Go 語言中複雜數據類型與數據庫字段之間 ⌘ Read more
Go 中的實時批處理: 高效數據處理的藝術
開篇:當實時性遇見批量處理 ————–在處理大量數據時,我們通常面臨兩個選擇:單條處理 和 批量處理。前者處理及時,但系統開銷大;後者吞吐量高,但可能增加延遲。那麼,有沒有一種方式能兼顧兩者的優勢?答案是——實時批處理(Real-time Batching)。爲什麼選擇 Go? ————-1.1 天生爲併發而生Go 的 Goroutine 和 Channel 機 ⌘ Read more
Running - 4 miles: 4.00 miles, 00:09:32 average pace, 00:38:06 duration
this week is going to be hell. with the travel and all the fires at work i can already tell.
#running #treadmill
I’ll Dood your Cat😊 Let’s go!! ⌘ Read more