Searching txt.sour.is

Twts matching #go
Sort by: Newest, Oldest, Most Relevant

使用 Go 進行 HTTP 流量重放測試
在 Web 安全測試、API 調試、流量回歸測試中,HTTP 流量重放(HTTP Traffic Replay)是一項重要的技術。它可以幫助我們復現問題、測試系統兼容性、進行安全研究等。在這篇文章中,我們將簡單探討 HTTP 流量重放的原理,並通過 Go 語言實現不同的流量重放方案,同時介紹常見的開源工具。(身爲一個在小公司裏的網安牛馬,總得幹些雜活🐂🐎)HTTP 流量重放的原理HTTP 流量重放 ⌘ Read more

⤋ Read More

Go:終於有了處理未定義字段的實用方案
衆所周知,Go 裏沒有 undefined,只有各類型的零值。多年來,Go 開發者一直依賴 JSON 結構標籤 omitempty 來解決 “字段可能缺失” 這一需求。然而omitempty 並不能覆蓋所有場景,而且常常讓人抓狂——到底什麼算 “空”?定義本就含糊不清。在 編碼(marshal) 時:切片和 map 只有在爲 nil 或長度爲 0 時纔算空。 指針只有 nil 時爲空。 ⌘ Read more

⤋ Read More

用 Go 語言開發一個石頭剪刀布遊戲,很簡單
本文將通過 Go 語言實現一個玩家與電腦對戰的石頭剪刀布遊戲,並重點講解如何通過 Go 的 crypto/rand 包生成安全的隨機數,確保遊戲的公平性。一、遊戲模型設計在編寫代碼之前,我們首先要設計遊戲的基本模型,包括參與者、動作和遊戲狀態。1. 用戶與動作遊戲的參與者有兩個:玩家和電腦。每個參與者可以做出三種選擇:石頭、剪刀或布。我們通過 Go 的枚舉類型來表示這些選擇。// 用戶類型type ⌘ Read more

⤋ Read More

Weightedrand:Go 權重隨機選擇
weightedrand (github.com/mroth/weightedrand) 是一個 Go 語言實現的權重隨機選擇庫,可以從一個元素列表中以不同的概率選擇一個元素,也就是所謂的加權隨機選擇(weighted random selection)。你可以爲每個元素設置 “權重”(可以理解爲概率的相對值),然後根據這些權重進行隨機選擇。安裝go get github.com/mroth/we ⌘ Read more

⤋ Read More

靜態程序分析入門之 Go 實踐筆記
編譯與靜態分析的關係在 Introduction to the Go compiler[5] 也能看到相似的流程,靜態分析主要發生在 IR 層,生成機器碼後端部分 (back-end) 那就是編譯器所考慮的了。• 詞法分析器(Scanner)結合正則表達式 (Regular Expression) ,通過詞法分析(Lexical Analysis)將源碼翻譯爲 token。 • 語法分析器( ⌘ Read more

⤋ Read More

Go 利用 github-com-miekg-dns 進行安全分析與防護
在網絡安全領域,DNS(域名系統)是攻擊者和防禦者都非常關注的目標。攻擊者可以利用 DNS 進行隧道通信、數據滲透、欺騙攻擊,而安全專家則需要檢測和防禦這些威脅。本文將簡單地介紹 github.com/miekg/dns 庫,並通過代碼演示如何利用它進行 DNS 監控、流量分析和攻擊檢測。miekg/dns 介紹miekg/dns 是 Go 語言中比較流行的 DNS 解析庫之一,它支持:自定義 D ⌘ Read more

⤋ Read More

Top Stories: iPhone 17 Air Rumors, Apple Watch Turns 10, and More
We’ve known for quite some time about Apple’s plans for a thinner “iPhone 17 Air” coming later this year, but wow, the latest dummy models give us our best look yet at just how thin this phone is going to be.

Image

Other Apple news and rumors this week included another iOS 18.5 beta, the 10th anniversary of the Apple Watch launch, and more … ⌘ Read more

⤋ Read More
In-reply-to » Anyone watching/watched Black Mirror Season 7? 😵‍💫😵 I've been watching the first episode and a couple of minutes into the third act then I was like ... Oh boy, I need a break! They're just so Fu__ing good, I'll give them that!

P.S: the couple first Seasons and Her (The movie) are the main reasons I find it a bit difficult to go back to mainstream social media or even care about smartphones 😆

⤋ Read More

ChanX:Go 構建無限緩衝通道
chanx (github.com/smallnest/chanx) 一個用環形緩衝區(ringbuffer)實現的無界通道(unbounded channel)的 Go 語言庫。它非常適合在需要異步處理、生產者快於消費者、或對標準通道容量受限(如 make(chan T, N))感到不滿足的場景中使用。爲什麼需要 Unbounded Channel?Go 原生的 chan 是有限容量的:默認是阻 ⌘ Read more

⤋ Read More
In-reply-to » Also, I should cut down on coffee. Seriously, I've nearly had a ... I honestly don't know what it was; A Panic attack? A heart attack? I dunno, I just felt like my heart and lungs were so about to burst I had to go for a run to cope.

@aelaraji@aelaraji.com I use to be a pot or more a day but have cut that back in the last 4 or so years to just 2-3 cups. Main reason was because I was getting jittery which didn’t happen before. I do think it is good to go without periodically (probably applies to more things than coffee) to just reset the system.

I don’t drink it often but decaf’s taste has gotten better too.

⤋ Read More

Go 1-24 讓項目工具管理更優雅的 tool 指令
工具管理的歷史難題———在 Go 1.24 之前,管理項目依賴的工具(如 linters、代碼生成器等)是一個棘手的問題。雖然有 go.mod 來管理代碼依賴,但工具依賴卻沒有一個官方的解決方案。社區曾流行的做法是創建一個名爲 tools.go 的文件,通過一種 “技巧” 來管理這些工具依賴://go:build toolspackage toolsimport (     ”gol ⌘ Read more

⤋ Read More

Also, I should cut down on coffee. Seriously, I’ve nearly had a … I honestly don’t know what it was; A Panic attack? A heart attack? I dunno, I just felt like my heart and lungs were so about to burst I had to go for a run to cope.

⤋ Read More

I had Chick-fil-A breakfast today (sausage, egg, and cheese biscuit, hash browns, coffee, and orange juice). Then at lunch my work place offered hot dogs. I had two (kosher, if that matters), plus a coke, a macadamia nuts cookie, and a small chocolate brownie.

So, here I am, at home, feeling hungry but guilty and refusing to eat anything else for the rest of the day. To top it off, I have only clocked 4,000 steps today (and I don’t feel like walking). I am going to hell, am I?

⤋ Read More

[$] Code signing for BPF programs
The Linux kernel can be configured so that
kernel modules must be signed or
otherwise authenticated to be loaded
into the kernel. Some BPF developers want that to be an option for BPF programs
as well — after all, if those are going to run as part of the kernel,
they should be subject to the same code-signing requirements. Blaise Boscaccy
and Cong Wang presented two different visions for how BPF code signing could
work at the 2025 Linux Storage, Filesystem, Memory … ⌘ Read more

⤋ Read More
In-reply-to » @bender This story just reminds me of the couple of times we've paid for things in cash 💰 💲 and the stupid banks with the ridiculous "scam alert policy" ask you all kind of dumb ass questions about what you need the cash for 🤦‍♂️ One of these days I need an excuse to buy something that costs a few $k just so I can answer when asked, "what do you need the cash for?" to which my response will be "drugs and hookers of course!" 🤣

@prologic@twtxt.net I would say “We are going to the adult’s toy store for our yearly haul”, though “going to a house of burlesque” would work too! LOL.

⤋ Read More
In-reply-to » Testing mentions, immediately followed by commas. Let's see: @prologic, this one is local, it might not break. Now, this one @ isn't local. Nor this @ one. Will they break. Let's find out!

I’ll see if I can fix this and write a test case for what’s going on here. I think this is made difficult now because folks like @eapl.me@eapl.me decide that it’s okay to have a . (period) in their # nick 🤣 tbh I think nick(s) should have rules of what they can and cannot be comprised of. i.e: no punctuation 🤦‍♂️

⤋ Read More
In-reply-to » All these remind me of the "blog" ability once existed in Yarnd. I hate to be the party pooper, but little to non interest from me. LOL. I am up to increase the length of a twtxt, though. It is rather limiting right now.

There we go. Restored all the old settings 👌

⤋ Read More

Go 定時任務調度從入門到實戰
在開發後臺服務時,我們經常需要處理定時任務。例如每天凌晨備份數據、每 5 分鐘檢查服務狀態、每小時發送統計報表…這些場景都需要可靠的定時任務調度機制。Go 語言就提供了強大的定時任務處理能力,既有標準庫的基礎功能,也有企業級的第三方解決方案。一、標準庫基礎用法———1. 簡單的單次延遲任務timer := time.NewTimer(3  time.Second) // 3秒後 ⌘ Read more

⤋ Read More

Badu-bus:Go 輕量級泛型發佈 - 訂閱事件總線
badu/bus (github.com/badu/bus) 是一個 Go 語言基於泛型實現的輕量級發佈 - 訂閱(Pub/Sub)事件總線庫。它允許不同的組件通過事件機制進行解耦通信,而不需要直接調用彼此的函數。它解決了什麼問題?組件解耦:發佈者和訂閱者彼此無感知,更靈活、可擴展,便於測試。 異步消息:消息可以異步發送和接收,提高系統性能和響應速度。 模塊化:有利於將系統拆分爲更小、 ⌘ Read more

⤋ Read More
In-reply-to » 💡 I had this crazy idea (or is it?) last night while thinking about Twtxt and Yarn.social 😅 There are two things I think that could be really useful additions to the yarnd UI/UX experience (for those that use it) and as "client" features (not spec changes). The two ideas are quite simple:

#event:abc123 Go Meetup – Sat Apr 27, 3pm @ Darling Harbour

⤋ Read More
In-reply-to » 💡 I had this crazy idea (or is it?) last night while thinking about Twtxt and Yarn.social 😅 There are two things I think that could be really useful additions to the yarnd UI/UX experience (for those that use it) and as "client" features (not spec changes). The two ideas are quite simple:

#poll:xyz123 Favorite Go framework?

  • Gin
  • Echo
  • Chi

⤋ Read More
In-reply-to » A mate and I had an amazing but also exhausting hike to the highest of the Three Emperor Mountains yesterday with perfect weather conditions. Sunny 18°C, blue sky with barly a cloud and a little welcoming breeze, just beautiful.

@lyse@lyse.isobeef.org You’re realling pushing it with those distances. 😅 I went for a quick 2km walk today, saw two deer, that’s it. 😅

What the heck is going on in 86.jpg? An art installation, apparently, but, uh, I wouldn’t trust that. 😂

⤋ Read More

Some A hole has been trying to pull every single Twtxt feed that existed/still exists since forever. How do I know? Welp’ They’ve been querying my Timeline™ instance for all of it, every single twtxt file and twt Hash they can find. 😆🤦 It must have been going on for days and I have just noticed… + it’s all coming from the same ASN AS136907 HWCLOUDS-AS-AP HUAWEI CLOUDS

Thank you Huawei for the DDos you sons of Glitches!!!

⤋ Read More

[$] The problem of unnecessary readahead
The final session in the memory-management track of the 2025 Linux Storage,
Filesystem, Memory-Management, and BPF Summit was a brief, last-minute
addition run by Kalesh Singh. The kernel’s readahead mechanism is
generally good for performance; it ensures that data is present by the time
an application gets around to asking for it. Sometimes, though, readahead
can go a little too far. ⌘ Read more

⤋ Read More
In-reply-to » @lyse It wasn’t our building, yeah, luckily. But I’m pretty scared it might happen some day. I think I’ll put more effort into preparing for that. But whatever I do, it would be horrific to lose all your stuff and the memories attached to it …

@bender@twtxt.net My choices might be a bit limited, at least going by this list: https://www.hetzner.com/storage/storage-box (That would be some incredibly cheap storage.) I’ll probably have to order such a box and then play with it a little bit to see what’s possible.

⤋ Read More

使用 Go 實現零停機處理數百萬個 WebSocket 連接
引言 —想象一下這樣的場景:你剛剛上線了一款實時聊天應用,用戶數量快速攀升至數十萬。然而,每次服務更新都會導致所有用戶連接斷開,他們需要手動刷新頁面才能重新連接。用戶反饋很差,因爲重要的消息會在服務更新期間丟失。這是一個經典的問題 —— 如何在不中斷服務的情況下更新和擴展 WebSocket 應用?WebSocket 技術爲現代 Web 應用提供了雙向實時通信能力,廣泛應用於聊天應用、遊戲、 ⌘ Read more

⤋ Read More

用 Go 語言打造高併發 MCP 服務器:理論、實戰與 AI 應用全景探索
在這個 AI 與大數據時代,構建一個高性能、可擴展的 MCP(Modular/Model Context Protocol)服務器已成爲打通應用與 AI 模型之間數據孤島的重要橋樑。本文將帶你深入瞭解 MCP 協議的設計理念、使用 Go 語言實現 MCP 服務器的詳細流程,以及 MCP 如何爲 AI 應用提供類似 USB-C 接口般的統一連接能力。 “MCP 提供統一的數據交換框架,幫助企業實 ⌘ Read more

⤋ Read More
In-reply-to » jenny really isn’t well equipped to handle edits of my own twts.

@kat@yarn.girlonthemoon.xyz It’s more like a cache, it stores things like “timestamp of the most recent twt we’ve seen per feed” or “last modification date” (to be used with HTTP’s if-modified-since header). You can nuke these files at any time, it might just result in more traffic (e.g., always getting a full response instead of just “HTTP 304 nope, didn’t change”).

@quark@ferengi.one Yes, I often write a couple of twts, don’t publish them, then sometimes notice a mistake and want to edit it. You’re right, as soon as stuff is published, threads are going to break/fork by edits.

⤋ Read More

如何用 go 搭建 MCP 服務
什麼是 MCP?———–MCP 是 “模型上下文協議(Model Context Protocol)” 的簡稱,用一句簡單通俗易懂的話描述:是一種讓 AI 模型能夠無縫連接到外部工具和數據源的標準化方式。想象它就像 AI 的“萬能接口”,能讓 AI 像用 USB 線連接設備一樣,輕鬆調用其他程序或服務。官方 MCP 架構圖————-MCP Hosts: 是指 LLM ⌘ Read more

⤋ Read More

Security updates for Monday
Security updates have been issued by Debian (glib2.0, jinja2, kernel, mediawiki, perl, subversion, twitter-bootstrap3, twitter-bootstrap4, and wpa), Fedora (c-ares, chromium, condor, corosync, cri-tools1.29, exim, firefox, matrix-synapse, nextcloud, openvpn, perl-Data-Entropy, suricata, upx, varnish, webkitgtk, yarnpkg, and zabbix), Mageia (giflib, gnupg2, graphicsmagick, and poppler), Oracle (delve and golang, go-toolset:ol8, grub2, and webkit2gtk3), Red Hat (kernel and kernel-rt), **S … ⌘ Read more

⤋ Read More

在 Go 中使用 Redis 管道提升性能
Redis 管道簡介 ———–Redis 的管道是一種優化技術,允許客戶端一次性發送多個命令到服務器,而無需逐一等待響應。服務器執行完所有命令後,再一次性返回所有結果。簡單來說,就是從 “一個一個送信” 變成“打包快遞”,大大減少了網絡通信的次數。來看看直觀的對比:無管道:發送命令 1,等待響應;發送命令 2,等待響應…… 每次都跑一個來回。 有管道:把命令 1、2、3 打包 ⌘ Read more

⤋ Read More

We’ve been on a trip to another city this weekend and one thing struck me as really odd:

The lack of “public water” in our cities.

Almost no way of washing your hands or going to the toilet or whatever. You can’t even pee in a bush, because a) that’s illegal and b) there are no bushes!

(It’s always been that way, I just never noticed before. 🥴)

⤋ Read More

用 Go 語言輕鬆構建 MCP 客戶端與服務器
★ 該文章已被 Model Context Protocol(MCP) 中文教程講解  收錄,歡迎 star 收藏。 若想獲取可執行的完整項目代碼,可關注本公衆號,回覆 MCP。前言模型上下文協議(Model Context Protocol,簡稱 MCP)是一種開放標準,旨在標準化大型語言模型(LLM)與外部數據源和工具之間的交互方式。隨着 MCP 越來越受歡迎,Go MCP 庫 ⌘ Read more

⤋ Read More

golang 每日一庫之 aceld-zinx
aceld/zinx 是一個基於 Go 語言開發的輕量級、高併發 TCP 服務器框架,專注於簡化遊戲服務器、長連接應用及消息中轉服務的開發。其設計目標是提供清晰的結構和高度可擴展性,幫助開發者快速構建高性能網絡服務。以下從核心特性、架構設計、應用場景等方面詳細介紹:一、核心特性輕量級與高併發 基於 Go 的 Goroutine 協程模型,實現高效併發處理,支持海量連接。 提供線程池(W ⌘ Read more

⤋ Read More
In-reply-to » @prologic in this case it isn't vendor lock-in. I believe they do it because the carrier "eats" the costs (the interest part of the instalments). The phones are fully unlocked.

“Move to iOS” app continuously refused to run as intended and expected, so couldn’t migrate mum’s Android based phone data. Most of her stuff is on a Google account, but not the SMS/MMS/RCS messages. Haven’t found a way to export, then import those into iOS.

She isn’t too happy having to keep the old phone just for the messages. Need to find a way to go through them, export multimedia attachments, and import them into iOS. I don’t think it’s going to happen, but I am not letting her know yet. 😅

⤋ Read More

Based on a recent study of the brains of mice I estimated the human brain to have 200B cells/neurons and 50,000T connections. We have several orders of magnitude to go before we reach that kind of scale with these fucking stupid Big LLMs 🤣 And the best part of all? 🧐 It is estimated that the human brain only consumes the equivalent of 5 Watts of power !!! 🤣🤣🤣

⤋ Read More

Security updates for Friday
Security updates have been issued by AlmaLinux (delve and golang and go-toolset:rhel8), Debian (webkit2gtk), Fedora (openvpn, thunderbird, uboot-tools, and zabbix), SUSE (expat, fontforge, govulncheck-vulndb, and kernel), and Ubuntu (haproxy and libsoup2.4, libsoup3). ⌘ Read more

⤋ Read More

[$] Management of volatile CXL devices
Compute\
Express Link (CXL) memory is not like the ordinary RAM that one might
install into a computer; it can come and go at any time and is often not
present when the kernel is booting. That complicates the management of
this memory. During the memory-management track of the 2025 Linux Storage,
Filesystem, Memory-Management, and BPF Summit, Gregory Price ran a session
on the challenges posed by CXL and how they might be addressed. ⌘ Read more

⤋ Read More

One was able to purchase iPhones on instalments (and interest free), whether they were associated with a carrier, or not. The only way to buy them on instalments now is if the are associated with a carrier; otherwise one gets charged the full amount up front.

So, yeah, going to return a couple of those this weekend.

⤋ Read More

Security updates for Thursday
Security updates have been issued by AlmaLinux (tomcat and webkit2gtk3), Debian (chromium), Fedora (ghostscript), Mageia (atop, docker-containerd, and xz), Red Hat (go-toolset:rhel8), SUSE (apache2-mod_auth_openidc, apparmor, etcd, expat, firefox, kernel, libmozjs-128-0, and libpoppler-cpp2), and Ubuntu (dino-im, linux, linux-aws, linux-aws-hwe, linux-azure, linux-azure-4.15, linux-gcp,
linux-gcp-4.15, linux-hwe, linux-kvm, linux-oracle, linux, linux-aws, linux-kvm, linux-l … ⌘ Read more

⤋ Read More
In-reply-to » @kate @eldersnake @abucci -- I've already spoken to @xuu on IRC about this, but the new SqliteCache backend I'm working on here, what are your thoughts regarding mgirations from old MemoryCache (which is now gone in the codebase in this branch). Do you care to migrate at all, or just let the pod re-fetch all feeds? 🤔

@abucci@anthony.buc.ci Apologies, the basic summary is as follows:

  • Decided to rewrite the cache backend.
  • It will now be a SQLite backend going forward.
  • I’m planning on no data migration.

⤋ Read More

Go - MCP SDK 新玩法:實現海報生成 MCP Server 與 DeepChat 無縫集成
DeepChat 是國內主導的一個非常優秀的智能助手,開源 2 個月,已經收穫 1k+ 的粉絲關注,最近聽說新版本已經支持 MCP,迫不及待開始嚐鮮。但做個什麼插件好了,無意看到阿里雲的 “創意海報生成” 接口文檔,索性給 DeepChat 添加一個 “海報生成” 的功能。構建 MCP Server 看過我前面文章的小夥伴應該知道,我以前一般使用 mark3labs/mcp-go 這個庫,但發現國 ⌘ Read more

⤋ Read More

Go 語言新版的迭代器是怎麼個事
很多流行的編程語言中都以某種方式提供迭代器,其中包括 C++、Java、Javascript、Python 和 Rust。Go 語言現在也加入了迭代器。iter 包是 Go 1.23 新增的標準庫,提供了迭代器的基本定義和相關操作。爲什麼需要迭代器——–在 Go 1.18 引入泛型之後,便可以很方便的定義一些泛型容器類型來提升編碼效率。例如我們可以基於 map 類型定義了一個集合類型—— ⌘ Read more

⤋ Read More

利用 Katana 作爲 Go 庫實現高性能 Web 爬蟲
在信息收集、安全測試等領域,高性能、高併發的 Web 爬蟲工具是核心基礎設施之一。ProjectDiscovery 出品的 Katana 是一個基於 Golang 編寫的輕量級爬蟲,它默認以 CLI 工具形式提供。但實際上,它也可以作爲庫被直接集成進你的 Go 項目中,從而實現更靈活的定製。本文將介紹:Katana 的設計理念與功能,如何將 Katana 作爲庫引入到我們的項目當中,如何編寫自定義 ⌘ Read more

⤋ Read More

golang 每日一庫之高性能無鎖隊列 bruceshao-lockfree
bruceshao/lockfree 是一個基於 Go 語言實現的高性能無鎖隊列庫,旨在通過無鎖(Lock-Free)算法提升多線程環境下的併發性能。其設計靈感來源於 Java 的 Disruptor 框架,但針對 Go 語言的特性進行了優化,適用於高吞吐量、低延遲的場景,如實時數據處理、高頻交易系統等。以下是該庫的核心特性、實現原理、性能對比及使用場景的詳細分析:核心特性無鎖設計基於 CAS(C ⌘ Read more

⤋ Read More
In-reply-to » @thecanine I mean I can restore whatever anyone likes, the problem is the last backup I took was 4 months ago 😭 So I decided to start over (from scratch). Just let me know what you want and I'll do it! I used the 4-month old backup to restore your account (by hand) and avatar at least 🤣

@prologic@twtxt.net “Indiana, let it go” 😂

⤋ Read More
In-reply-to » guys help how do i unmute a twt i accidentally hit the wrong button

@kat@yarn.girlonthemoon.xyz It’s very well hidden, it took me a while to find that. Go to “Settings” in the menu bar up top → “Profile and Privacy” (already selected) → on the right at “User Info” → “1 Muted” → click the link with the minus in the circle at the message you want to unmute.

⤋ Read More
In-reply-to » @kat I think it happens if you don't follow them. Replies used to be broken if so, but not sure if @prologic ever fixed that. I used not to follow him, so that he would see the broken mentions, and feel shame (he didn't, he is shameless! LOL), but ever since the re-creation of my account I just decided to follow, so I don't know if the issue is fixed or not.

@bender@twtxt.net i had to go to your instance to see the root post because I ACCIDENTALLY MUTED THE THREAD LMFAOOOOO but interesting re: unfollowing!

⤋ Read More
In-reply-to » I am not interested at all. If I want to interact/socialise/whatever on the Fediverse (which I do), I simply use it. I would like to keep twtxt separate.

Adding to this, we already tried. It didn’t go too well. Slightly related—because it is a third party “integration”—I might be a “smaller group” member, but I don’t care much about one-way feeds (mostly RSS from blogs, news articles, etc.) either.

⤋ Read More

Fifty Years of Open Source Software Supply Chain Security (Queue)
ACM Queue looks at\
the security problem in the light of a report on Multics security that
was published in 1974.

We are all struggling with a massive shift that has happened in the
past 10 or 20 years in the software industry. For decades, software
reuse was only a lofty goal. Now it’s very real. Modern
programming environments such as Go, Node, and Rust have made it
trivial to reuse work by others, but our … ⌘ Read more

⤋ Read More

效率工具:使用 air 熱重載 Go 應用程序
在項目開發階段,熱重載技術非常有用,通過熱重載,可以實現在無需手動干預的情況下,修改代碼文件後,自動重啓 Go 應用。這極大地提升了開發體驗,同時也節約了我們的開發時間。本文我們一起來體驗一下使用 air 熱重載 Go 應用程序,提高開發效率。簡介air 是爲 Go 應用開發設計的一款支持熱重載的命令行工具。以下是 air 官方總結的特色:• 彩色的日誌輸出 • 自定義構建或必要的命令 ⌘ Read more

⤋ Read More

Go API 中的上下文取消機制
在分佈式系統和微服務架構中,高併發請求和資源管理是每個開發者必須面對的挑戰。尤其是在處理長時間運行的任務時,如何實現優雅的取消和超時控制,直接關係到系統的穩定性和用戶體驗。Go 語言通過context包提供了一套標準化的解決方案,本文將深入探討其核心用法與最佳實踐。 上下文(Context)的本質與作用——————context.Context是 Go 語言中用於傳遞請求範 ⌘ Read more

⤋ Read More

Grab the iPhone 16e Default Wallpaper
Perhaps you recently saw that Apple had released the iPhone 16e and drooled with envy at the iPhone 16e default wallpaper, which sort of looks like a drop of Liquid Metal (why did macOS Sequoia autocorrect capitalize “Liquid Metal”? Who knows, but it did it again, so let’s go with it) or maybe a water … Read MoreRead more

⤋ Read More
In-reply-to » Markdown and the Slow Fade of the Formatting Fetish - a nice article about Markdown VS proprietary formatting. With quotes like "Microsoft Office works in an office where you pretend to work until you can finally go home." 😄

@arne@uplegger.eu I’m very glad I only rarely have to deal with .docx & Co. And when I have to, 99% is in read mode only. Even though, I don’t think that Markdown is the best choice, I use it on a daily basis. Some things, like links, in reStructuredText are better in my opinion.

Jira just resists to switch to Markdown and forces us to use its silly markup language.

For real typesetting, LaTeX is the way to go. But I very, very rarely do that.

⤋ Read More

[$] Page allocation for address-space isolation
Address-space isolation may well be, as Brendan Jackman said at the
beginning of his memory-management-track session at the 2025 Linux Storage,
Filesystem, Memory-Management, and BPF Summit, “some security
bullshit”. But it also holds the potential to protect the kernel from
a wide range of vulnerabilities, both known and unknown, while reducing the
impact of existing mitigations. Implementing address-space isolation with
reasonable performance, though, is going to require some signific … ⌘ Read more

⤋ Read More

使用 Go 構建併發的 KV 存儲系統
帶你使用 Go 編寫一個簡單的 KV 存儲系統,使用Fiber框架,支持併發操作並實現 TTL 功能。通過本教程,你可以:瞭解 KV 存儲的底層工作原理 瞭解 CRUD 如何實現 瞭解併發處理,比如鎖的使用 瞭解 TTL 功能如何實現 初始化項目——–首先,創建一個新的項目目錄並進行初始化:go mod init mszluKV安裝依賴——-//fiber ⌘ Read more

⤋ Read More

基於 Go 構建百萬級反向代理服務
在現今 Web 開發中,高效安全地管理海量流量是系統架構設計的核心命題。反向代理作爲客戶端與後端服務之間的智能調度器,已成爲應對高併發場景的利器。1. 反向代理反向代理是一種位於服務器端的代理服務器,它代表後端服務器接收客戶端的請求,並將請求轉發到內部網絡中的實際服務器,最終將服務器的響應返回給客戶端。負載均衡:通過輪詢 / 加權算法分發請求至多臺後端服務器 安全防護盾:隱藏真實服務器 IP ⌘ Read more

⤋ Read More
In-reply-to » I have just received the royalties for the last book: 98 euros for the four-month period, about 24 euros a month on average. Not even enough for the gym membership. If you have to keep some knowledge: don't write for money, the paper (or ebook) industry is in a very bad way, the margins for the author are very small and piracy is devastating.

well, that leads to a long conversation.

Piracy is a difficult topic which is very personal, so I won’t say much about it.

On writing books, I’ve tried along with other digital products such as courses and videogames, and I got to confess that it has been hard for me.

If it helps, I think it all reaches our expectations on the activity and the result. If royalties is the expectation, it’s going to be slow. By 5% of royalties, for a rough example, a huge amount of sales will be required to get a decent “wage”, so I’ve understood of doing it by the side of a normal employment although it has been discouraging and a bit sad.

I have reflected about it in Spanish here: https://sembrandojuegos.substack.com/p/sobre-expectativas-al-crear-juegos

⤋ Read More
In-reply-to » I have just received the royalties for the last book: 98 euros for the four-month period, about 24 euros a month on average. Not even enough for the gym membership. If you have to keep some knowledge: don't write for money, the paper (or ebook) industry is in a very bad way, the margins for the author are very small and piracy is devastating.

@prologic@twtxt.net Fully agreed. I’m far more likely to buy such mediums when DRM-free. I never go near Amazon eBooks etc because of their lock-in, and I have a Kobo eReader which needs to have the books side loaded unless directly from the Kobo store. I prefer DRM-free files every time.

⤋ Read More

使用 Go 實現服務端事件推送 SSE
背景–在對內部 CRM 項目進行優化時,我們發現項目中的站內信功能目前採用了 WebSocket 來實現消息推送。然而,對於站內信這種低頻的推送場景來說,維護一個長連接的成本相對較高。WebSocket 通常用於需要實時雙向通信的應用,而我們需要的只是簡單的單向推送。經過考慮,我們決定使用一種更輕量級的技術——Server-Sent Events(SSE)來實現站內信的推送。這種技術不僅可以減 ⌘ Read more

⤋ Read More

使用 Go 進行 SSH 隧道:輕鬆構建安全通道
使用 Go 進行 SSH 隧道:輕鬆構建安全通道 ————————-SSH 隧道常常被用來安全地穿越防火牆、保護數據傳輸以及遠程訪問受限服務。本文將帶你一步步瞭解如何用 Go 語言搭建一個 SSH 隧道,並結合實際案例分享一些個人經驗和最佳實踐,讓你輕鬆上手這一強大工具。 什麼是 SSH 隧道? —————SSH 隧道(SSH Tunnel)是 ⌘ Read more

⤋ Read More

搞懂常見 Go ORM 系列 - Ent 框架詳解
在 Go ORM 開篇中我們將 Go ORM 框架分成了三類🌲 反射型主要通過反射機制將結構體映射到數據庫表上,代表作爲 go-gorm/gorm🌲 代碼生成型通過代碼生成工具預先生成數據模型及查詢構建器,代表作有 ent/ent 和日益流行的 go-gorm/gen🌲 SQL 增強型基於原生 SQL 庫進行封裝和擴展,既保留 SQL 的靈活性,又提供了一系列便捷函數,代表作爲 jmoiron/s ⌘ Read more

⤋ Read More

Go 語言錯誤處理:Panic 與 Error 的抉擇
在 Go 語言的開發實踐中,錯誤處理機制是構建健壯應用程序的核心要素。與其他語言不同,Go 通過顯式的錯誤返回和獨特的 panic/recover 機制形成了獨特的錯誤處理哲學。本文將深入探討 panic 與 error 的本質區別,並通過實際場景分析幫助開發者做出正確的技術選擇。 錯誤處理機制的核心差異———–Error 的顯式傳遞特性Go 語言將 error 定義爲內置接口類型, ⌘ Read more

⤋ Read More

Go 1-25:工具鏈優化與運行時改進
Go 語言自誕生以來,始終保持着穩定的迭代節奏。2025 年 8 月即將發佈的 Go 1.25 版本在工具鏈、運行時、編譯器及標準庫等方面都帶來了值得關注的改進。本文將從實際開發角度出發,詳細解析這些變化的技術細節及其對開發者產生的實際影響。工具鏈增強—–構建系統優化go build命令的-asan選項在 1.25 版本中默認啓用了內存泄漏檢測機制。該功能會在程序退出時自動檢查未釋放的 C ⌘ Read more

⤋ Read More

** Late March Snow **
The forecast predicted snow, but even with that knowledge I held out hope that it wouldn’t. The shade over the window in the bedroom doesn’t close all the way. It always stops short of totally covering the window with about an inch further to go. It is too short. When I woke up this morning there was a flat grey line of light streaming into the room through the gap left by the too short shade. So, I spent some time shoveling this morning. Probably sooner than I ought to have since it’s still coming down. It’s 80ish de … ⌘ Read more

⤋ Read More
In-reply-to » DOGE To Rewrite SSA Codebase In 'Months' Longtime Slashdot reader frank_adrian314159 writes: According to an article in Wired, Elon Musk has appointed a team of technologists from DOGE to "rewrite the code that runs the SSA in months." This codebase has over 60 million lines of COBOL and handles record keeping for all American workers and payments for all Social Security recipients. Given that the code has to track the byzantine ... ⌘ Read more

Ehhh yeah, what could go wrong 🤔 😵‍💫

⤋ Read More

Go 語言中 Redis 管道的性能潛力
在現代分佈式系統架構中,Redis 憑藉其卓越的性能表現已成爲不可或缺的緩存和數據存儲組件。但在高併發場景下,如何突破網絡 I/O 瓶頸成爲開發者面臨的重要挑戰。本文將深入探討 Go 語言中 Redis 管道的實現原理,並通過詳實的代碼示例展示其性能優化之道。Redis 交互模式的演進之路—————傳統 Redis 客戶端的工作模式遵循 “請求 - 響應” 的同步範式。當執行S ⌘ Read more

⤋ Read More

golang 每日一庫之 base64Captcha
今天要介紹的庫 mojocn/base64Captcha 是一個用於 Go 語言的高效驗證碼生成庫,支持圖片、音頻等多種驗證碼格式,並且可以通過 base64 編碼輸出,方便前端直接使用。該庫廣泛用於 Web 應用、REST API 以及需要身份驗證的系統中,以增強安全性。主要功能——–支持多種驗證碼類型數字驗證碼 (DriverDigit):僅包含數字,適用於一般驗證碼場 ⌘ Read more

⤋ Read More