Searching txt.sour.is

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

#Meta to the #EU: “the focus should be on creating a regulatory infrastructure that ensures any licence that is sufficiently permissive for the user is considered open source, rather than anointing specific licences as “open source”.”

Brilliant, sure, let’s ignore existing definitions and go with gut feeling (incidently, Meta has a gut feeling generator).

Source: https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/14625-Apply-AI-Strategy-strengthening-the-AI-continent/F3563576_en

#OpenSource

⤋ Read More
In-reply-to » Okay, here’s a thing I like about Rust: Returning things as Option and error handling. (Or the more complex Result, but it’s easier to explain with Option.)

@prologic@twtxt.net I’d say: Yes, because in Go it’s easier to ignore errors.

We’re talking about this pattern, right?

f, err := os.Open("filename.ext")
if err != nil {
    log.Fatal(err)
}

Nothing stops you from leaving out the if, right? 🤔

⤋ Read More
In-reply-to » Just discovered how easy it is to recall my last arg in shell and my brain went 🤯 How come I've never learned about this before!? I wonder how many other QOL shortcuts I'm missing on 🥲

@aelaraji@aelaraji.com Oh, that’s great! I haven’t heard about any of them before either. There’s also a caveat though, that I ran right into the very first time I tried this in zsh:

$ ls > /dev/null
$ echo $_
--color=tty

Yeah, exactly what you think:

$ which ls
ls: aliased to ls --color=tty

Alt+. is going to be my favorite one! In the above, it would also give me /dev/null, which might be probably more what I would expect.

⤋ Read More
In-reply-to » FFS! Can't I just get results, accurate no BS results? No erroneous/misleading AI-Slop of a summary I've never asked for ? I get it, there is plenty of people who LOooove (if not worship) that shit, Good for them! But at least make it opt-in or add in some kind of "Do Not Slop" browser option (as if the "Do Not Track" one made a difference, but I digress). Shit's only going down-hill from here, I might as well as just spin up my own Searx instance and call it a day.

@movq@www.uninformativ.de neither do I 😆 and I’m going full Albert Camus mode. Embracing the Absurdism of life just to cope, it’s the only choice I have left.

⤋ Read More

FFS! Can’t I just get results, accurate no BS results? No erroneous/misleading AI-Slop of a summary I’ve never asked for ? I get it, there is plenty of people who LOooove (if not worship) that shit, Good for them! But at least make it opt-in or add in some kind of “Do Not Slop” browser option (as if the “Do Not Track” one made a difference, but I digress). Shit’s only going down-hill from here, I might as well as just spin up my own Searx instance and call it a day.

⤋ Read More
In-reply-to » Fuck me sideways, Rust is so hard. Will we ever be friends?

@prologic@twtxt.net I’m trying to call some libc functions (because the Rust stdlib does not have an equivalent for getpeername(), for example, so I don’t have a choice), so I have to do some FFI stuff and deal with raw pointers and all that, which is very gnarly in Rust – because you’re not supposed to do this. Things like that are trivial in C or even Assembler, but I have not yet understood what Rust does under the hood. How and when does it allocate or free memory … is the pointer that I get even still valid by the time I do the libc call? Stuff like that.

I hope that I eventually learn this over time … but I get slapped in the face at every step. It’s very frustrating and I’m always this 🤏 close to giving up (only to try again a year later).

Oh, yeah, yeah, I guess I could “just” use some 3rd party library for this. socket2 gets mentioned a lot in this context. But I don’t want to. I literally need one getpeername() call during the lifetime of my program, I don’t even do the socket(), bind(), listen(), accept() dance, I already have a fully functional file descriptor. Using a library for that is total overkill and I’d rather do it myself. (And look at the version number: 0.5.10. The library is 6 years old but they’re still saying: “Nah, we’re not 1.0 yet, we reserve the right to make breaking changes with every new release.” So many Rust libs are still unstable …)

… and I could go on and on and on … 🤣

⤋ Read More

It all started in New York in the early 1980s. Click, now 85, and his friends were sitting at the long bar of the New York Athletic club reading magazine articles about boxing, fencing, judo and wrestling. “One of my mates said, ‘Dude, we don’t do any of those things.’” They had to face it. They were dull. They decided to embrace their dullness.

As a joke, they started The Dull Men’s Club, which involved some very silly, dull activities. They chartered a tour bus but didn’t go anywhere. “We toured the bus. We walked around the outside of the bus a few times. And the driver explained the tyre pressures and turned on the windscreen wipers.”

https://www.theguardian.com/society/2025/jun/09/meet-the-members-of-the-dull-mens-club-some-of-them-would-bore-the-ears-off-you

⤋ Read More
In-reply-to » So I was using this function in Rust:

@lyse@lyse.isobeef.org Rust is so different and, at the same time, so complex – it’s not far fetched to assume that I simply don’t understand what’s going on here. The docs appear to be clear, but alas … is it a bugs in the docs? Is it a lack of experience on my part? Who knows.

By the way, looks like there was a bit of a discussion regarding that name:

https://github.com/rust-lang/rust/issues/120048

⤋ Read More

Hmmm 🧐 Not what I thought was going on… No bug…

 time="2025-06-14T15:24:25Z" level=info msg="updating feeds for 8 users"
 time="2025-06-14T15:24:25Z" level=info msg="skipping 0 inactive users"
 time="2025-06-14T15:24:25Z" level=info msg="skipping 0 subscribed feeds"
 time="2025-06-14T15:24:25Z" level=info msg="updating 80 sources (stale feeds)"

⤋ Read More

Go 項目開發中,遷移數據庫最佳方案
數據庫遷移是構建和維護 Go 應用的重要環節。它能保持數據庫模式與你的代碼庫同步,處理更新,並確保你的應用在演進過程中始終可靠。選擇合適的遷移工具可以節省時間、減少錯誤,並使部署更加順暢。本文將深入探討適用於 Go 的最佳數據庫遷移工具,通過示例、對比和實用見解,幫助你爲項目挑選合適方案。我曾經歷過手動遷移的繁瑣與模式不匹配的混亂,因此會以易於理解的方式剖析每款工具的優勢、特點和使用場景。讓我們一 ⌘ Read more

⤋ Read More

Go 項目開發中,遷移數據庫最佳方案
數據庫遷移是構建和維護 Go 應用的重要環節。它能保持數據庫模式與你的代碼庫同步,處理更新,並確保你的應用在演進過程中始終可靠。選擇合適的遷移工具可以節省時間、減少錯誤,並使部署更加順暢。本文將深入探討適用於 Go 的最佳數據庫遷移工具,通過示例、對比和實用見解,幫助你爲項目挑選合適方案。我曾經歷過手動遷移的繁瑣與模式不匹配的混亂,因此會以易於理解的方式剖析每款工具的優勢、特點和使用場景。讓我們一 ⌘ Read more

⤋ Read More

Tasmania likely to end the day with a state election underway
Premier Jeremy Rockliff is expected to go to the state’s governor later today to seek a snap election after parliament passes an emergency budget supply bill. ⌘ Read more

⤋ Read More

golang 每日一庫之 Zinx
Zinx 是一個用 Go 語言編寫的輕量級、併發 TCP 服務器框架,旨在幫助初學者深入理解 TCP 服務端開發的核心架構,同時具有生產級特性的模塊化設計 。倉庫地址https://github.com/aceld/zinx設計理念學習導向 :源碼精簡,框架和教程同步開發,分版本迭代,一步步構建功能,降低學習門檻 。 生產適用 :模塊化、擴展性強,已被用於遊戲服務 ⌘ Read more

⤋ Read More

golang 每日一庫之 Zinx
Zinx 是一個用 Go 語言編寫的輕量級、併發 TCP 服務器框架,旨在幫助初學者深入理解 TCP 服務端開發的核心架構,同時具有生產級特性的模塊化設計 。倉庫地址https://github.com/aceld/zinx設計理念學習導向 :源碼精簡,框架和教程同步開發,分版本迭代,一步步構建功能,降低學習門檻 。 生產適用 :模塊化、擴展性強,已被用於遊戲服務 ⌘ Read more

⤋ Read More

上下文取消鏈:摧毀我們支付系統的 bug
一個看似無害的 Go 語言特性如何引發級聯故障,導致了 110,000 美元的交易損失。警報響起時,我們的支付處理系統已經癱瘓。信用卡交易失敗、訂閱無法續訂、客服聊天窗口被憤怒的消息淹沒。一次常規部署演變成了我們兩年內最嚴重的生產事故。罪魁禍首?對 Go 語言上下文取消的細微誤解,它引發了一連串我從未預料到的反應。背景:一次 “簡單” 的優化三週前,我接到了優化支付處理流程的任務。系統每分鐘處理數 ⌘ Read more

⤋ Read More

上下文取消鏈:摧毀我們支付系統的 bug
一個看似無害的 Go 語言特性如何引發級聯故障,導致了 110,000 美元的交易損失。警報響起時,我們的支付處理系統已經癱瘓。信用卡交易失敗、訂閱無法續訂、客服聊天窗口被憤怒的消息淹沒。一次常規部署演變成了我們兩年內最嚴重的生產事故。罪魁禍首?對 Go 語言上下文取消的細微誤解,它引發了一連串我從未預料到的反應。背景:一次 “簡單” 的優化三週前,我接到了優化支付處理流程的任務。系統每分鐘處理數 ⌘ Read more

⤋ Read More

Go 定時任務筆記
Go Timer,Ticker,Sleep———————time.Timertime.Timer 是一個單次的定時器,在指定時間後觸發一次後就不再重複。雖然說觸發後不會再次觸發,但資源不會自己就釋放了,需要調用Stop()方法來釋放資源否則還在內存中。在 Timer 結束後可以用Reset()方法重置計時器 (要在 Stop() 之後或未觸發時使用)。基於這種特性 Ti ⌘ Read more

⤋ Read More

Go 定時任務筆記
Go Timer,Ticker,Sleep———————time.Timertime.Timer 是一個單次的定時器,在指定時間後觸發一次後就不再重複。雖然說觸發後不會再次觸發,但資源不會自己就釋放了,需要調用Stop()方法來釋放資源否則還在內存中。在 Timer 結束後可以用Reset()方法重置計時器 (要在 Stop() 之後或未觸發時使用)。基於這種特性 Ti ⌘ Read more

⤋ Read More

Golang 裏普通 map 不用鎖,咋解決協程安全?
在 Go 語言開發中,map 是常用的數據結構,但原生 map 在併發讀寫時會導致 panic。這是因爲 Go 的設計哲學是 “顯式優於隱式”,不自動處理併發安全問題,需要開發者根據場景選擇合適的併發控制策略。本文將深入探討三種主流解決方案,並分析它們的適用場景和性能特點。方案一:官方推薦的 sync.Map基本用法sync.Map是 Go 標準庫提供的線程安全 map 實現,適合讀多寫少的場景: ⌘ Read more

⤋ Read More

Golang 裏普通 map 不用鎖,咋解決協程安全?
在 Go 語言開發中,map 是常用的數據結構,但原生 map 在併發讀寫時會導致 panic。這是因爲 Go 的設計哲學是 “顯式優於隱式”,不自動處理併發安全問題,需要開發者根據場景選擇合適的併發控制策略。本文將深入探討三種主流解決方案,並分析它們的適用場景和性能特點。方案一:官方推薦的 sync.Map基本用法sync.Map是 Go 標準庫提供的線程安全 map 實現,適合讀多寫少的場景: ⌘ Read more

⤋ Read More

在 Go 中爲什麼推薦使用空結構體作爲 Context 的 key
使用 Context 進行傳值我們知道 Context 主要有兩種用法,控制鏈路和安全傳值。在此我來演示下如何使用 Context 進行安全傳值:package mainimport (    ”context”    ”fmt”)const requestIdKey = ”request-id”func main() {    ctx := context.Background()    // ⌘ Read more

⤋ Read More

在 Go 中爲什麼推薦使用空結構體作爲 Context 的 key
使用 Context 進行傳值我們知道 Context 主要有兩種用法,控制鏈路和安全傳值。在此我來演示下如何使用 Context 進行安全傳值:package mainimport (    ”context”    ”fmt”)const requestIdKey = ”request-id”func main() {    ctx := context.Background()    // ⌘ Read more

⤋ Read More

Samsung’s Summer Sale Includes Steep Discounts on Monitors, TVs, Galaxy Phones, and More
Samsung’s new Discover Samsung sale is still going on this weekend, and it includes savings on monitors, TVs, Galaxy products, and more.

Image

_Note: MacRumors is an affiliate partner with Samsung. When you click a link and make a purchase, we may receive a small payment, which helps us keep the site … ⌘ Read more

⤋ Read More

My emergency doctor friend watched The Pitt and said it could be set in Australia
If you have had the unfortunate need to turn up to an emergency department, I hope that it is not because in Australia in 2025, you can’t afford to go anywhere else. ⌘ Read more

⤋ Read More

Security updates for Friday
Security updates have been issued by AlmaLinux (go-toolset:rhel8, golang, nodejs:20, nodejs:22, openssh, and python36:3.6), Debian (edk2, libfile-find-rule-perl, and webkit2gtk), Fedora (emacs, libvpx, perl-FCGI, and seamonkey), Mageia (cifs-utils), Red Hat (containernetworking-plugins, go-toolset:rhel8, golang, gvisor-tap-vsock, krb5, mod_auth_openidc:2.3, protobuf, and thunderbird), Slackware (seamonkey), SUSE (gimp, gnutls, haproxy, opensaml, openssh, openvpn, python-crypto … ⌘ Read more

⤋ Read More

Go 項目該擁抱 Monorepo 嗎?Google 經驗、etcd 模式及白盒交付場景下的深度剖析
大家好,我是 Tony Bai。在 Go 語言的生態系統中,我們絕大多數時候接觸到的項目都是遵循 “一個代碼倉庫(Repo),一個 Go 模塊(Module)” 的模式。這種清晰、獨立的組織方式,在很多場景下都運作良好。然而,當我們放眼業界,特別是觀察像 Google 這樣的技術巨頭,或者深入研究 etcd 這類成功的開源項目時,會發現另一種代碼組織策略——Monorepo(單一代碼倉庫)——也在 ⌘ Read more

⤋ Read More

Go 項目該擁抱 Monorepo 嗎?Google 經驗、etcd 模式及白盒交付場景下的深度剖析
大家好,我是 Tony Bai。在 Go 語言的生態系統中,我們絕大多數時候接觸到的項目都是遵循 “一個代碼倉庫(Repo),一個 Go 模塊(Module)” 的模式。這種清晰、獨立的組織方式,在很多場景下都運作良好。然而,當我們放眼業界,特別是觀察像 Google 這樣的技術巨頭,或者深入研究 etcd 這類成功的開源項目時,會發現另一種代碼組織策略——Monorepo(單一代碼倉庫)——也在 ⌘ Read more

⤋ Read More

Security updates for Thursday
Security updates have been issued by Debian (chromium and mariadb-10.5), Oracle (firefox, ghostscript, git, go-toolset:ol8, golang, kernel, krb5, mingw-freetype and spice-client-win, nodejs:20, nodejs:22, perl-CPAN, python36:3.6, rsync, varnish, and varnish:6), Red Hat (firefox, thunderbird, and webkit2gtk3), Slackware (curl and python3), SUSE (apache-commons-beanutils, apache2-mod_security2, avahi, buildkit, ca-certificates-mozilla, cloud-regionsrv-client, cloud-regionsrv-client, py … ⌘ Read more

⤋ Read More

golang 每日一庫之 DDD 框架 freedo
Freedom:自由不是亂來,而是架構有道———————你是不是寫 Go 寫得挺開心的,直到有一天產品說: “這個業務流程以後會變、會拆、可能還會上天。”於是你開始發愁:怎麼寫纔不會三個月後改到哭? 怎麼解耦、怎麼擴展、怎麼不踩坑? 這時候,Freedom 躍馬而來,大喊一句: “用我!讓你寫得自由、改得瀟灑、跑得像風!”什麼是 Freedom—– ⌘ Read more

⤋ Read More

golang 每日一庫之 DDD 框架 freedo
Freedom:自由不是亂來,而是架構有道———————你是不是寫 Go 寫得挺開心的,直到有一天產品說: “這個業務流程以後會變、會拆、可能還會上天。”於是你開始發愁:怎麼寫纔不會三個月後改到哭? 怎麼解耦、怎麼擴展、怎麼不踩坑? 這時候,Freedom 躍馬而來,大喊一句: “用我!讓你寫得自由、改得瀟灑、跑得像風!”什麼是 Freedom—– ⌘ Read more

⤋ Read More

Biggest 3D tapestry in Australia took 10,000 hours to make
One clear, bold vision and thousands of hours of specialised, meticulous work have resulted in Welcome to Country, a groundbreaking tapestry soon to go on show in Melbourne’s west. ⌘ Read more

⤋ Read More

golang 每日一庫之 GoAdmin
你是不是曾經想用 Go 寫個後臺系統,結果一不小心就寫成了 Bug 系統?是不是寫到權限控制的時候,感覺自己變成了權限受害者?是不是本來想安安心心做個 CRUD 工人,結果被前端 UI 折磨到懷疑人生?別怕,GoAdmin 來拯救你了!什麼是 GoAdmin簡單說,GoAdmin 就是 Go 語言界的 “萬能後臺神器”。它能幫你:三分鐘起飛 :快速搭出一個後臺系統; 一行不寫也 ⌘ Read more

⤋ Read More

golang 每日一庫之 GoAdmin
你是不是曾經想用 Go 寫個後臺系統,結果一不小心就寫成了 Bug 系統?是不是寫到權限控制的時候,感覺自己變成了權限受害者?是不是本來想安安心心做個 CRUD 工人,結果被前端 UI 折磨到懷疑人生?別怕,GoAdmin 來拯救你了!什麼是 GoAdmin簡單說,GoAdmin 就是 Go 語言界的 “萬能後臺神器”。它能幫你:三分鐘起飛 :快速搭出一個後臺系統; 一行不寫也 ⌘ Read more

⤋ Read More

用 Go 語言實現用戶一鍵登錄,有哪些可靠的方案
一鍵登錄是現代應用中提升用戶體驗的關鍵功能,本文將深入探討 Go 語言實現一鍵登錄的幾種可靠方案,並提供完整的代碼實現和對比分析。方案一:短信驗證碼登錄(最常用)實現原理用戶輸入手機號 服務器發送短信驗證碼 用戶輸入驗證碼完成登錄 完整代碼實現package mainimport(“crypto/rand”“fmt”“math/big”“net/http”“time”“githu ⌘ Read more

⤋ Read More

用 Go 語言實現用戶一鍵登錄,有哪些可靠的方案
一鍵登錄是現代應用中提升用戶體驗的關鍵功能,本文將深入探討 Go 語言實現一鍵登錄的幾種可靠方案,並提供完整的代碼實現和對比分析。方案一:短信驗證碼登錄(最常用)實現原理用戶輸入手機號 服務器發送短信驗證碼 用戶輸入驗證碼完成登錄 完整代碼實現package mainimport(“crypto/rand”“fmt”“math/big”“net/http”“time”“githu ⌘ Read more

⤋ Read More

‘A shemozzle’: NT museum chair resigns amid fallout of CBD gallery plan
The long-standing chair of the Museum and Art Gallery of the NT has quit her position, just weeks after an announcement that a planned $150 million Darwin CBD art gallery may not be going ahead. ⌘ Read more

⤋ Read More

When I chose the MIT license for all of my software, I thought:

“Should I use GPL, which I don’t really understand? Is that worth it? Yeah, there is a theoretical possibility that some company might use my code in their proprietary product … and then what? Should I sue them to enforce the GPL? I’m not going to do that anyway, so I’ll just use the MIT license.”

And now we have those LLM scrapers and now it’s suddenly a reality that these companies (ab)use my code. I can see it in my logs. I didn’t expect that back then.

GPL wouldn’t help, either, of course. (Regardless, I now think that GPL would have been the better choice anyway.)

I’m honestly considering taking my code and website offline. Maybe make it accessible through some obscure protocol like Gopher or Gemini, but no more HTTP.

(Yes, Anubis might help. Temporarily.)

I’m just tired.

⤋ Read More

Golang 字符串拼接 6 種方法性能對比與最佳實踐
在 Go 語言中,字符串 (string) 是不可變 (immutable) 的數據類型,這意味着每次字符串拼接操作實際上都會創建一個新的字符串對象。對於需要頻繁拼接字符串的場景,選擇合適的方法對性能有顯著影響。本文將全面分析 6 種常見的字符串拼接方式,並通過基準測試揭示它們的性能差異。6 種字符串拼接方法詳解1. 直接使用+運算符funcconcatOperator(s string, n i ⌘ Read more

⤋ Read More

Golang 字符串拼接 6 種方法性能對比與最佳實踐
在 Go 語言中,字符串 (string) 是不可變 (immutable) 的數據類型,這意味着每次字符串拼接操作實際上都會創建一個新的字符串對象。對於需要頻繁拼接字符串的場景,選擇合適的方法對性能有顯著影響。本文將全面分析 6 種常見的字符串拼接方式,並通過基準測試揭示它們的性能差異。6 種字符串拼接方法詳解1. 直接使用+運算符funcconcatOperator(s string, n i ⌘ Read more

⤋ Read More

Go 語言 fsm 源碼解讀,這一次讓你徹底學會有限狀態機
我在文章《在 Go 中如何使用有限狀態機優雅解決程序中狀態轉換問題》中講解了有限狀態機的概念,並介紹了 Go 中有限狀態機 fsm 包的使用。本篇文章,我將更進一步,直接通過解讀源碼的方式,讓你深刻理解 fsm 是如何實現的,這一次你將徹底掌握有限狀態機。源碼解讀廢話不多說,我們直接上代碼。結構體首先 fsm 包定義了一個結構體 FSM 用來表示狀態機。 https://github.com/lRead more

⤋ Read More

Go 語言 fsm 源碼解讀,這一次讓你徹底學會有限狀態機
我在文章《在 Go 中如何使用有限狀態機優雅解決程序中狀態轉換問題》中講解了有限狀態機的概念,並介紹了 Go 中有限狀態機 fsm 包的使用。本篇文章,我將更進一步,直接通過解讀源碼的方式,讓你深刻理解 fsm 是如何實現的,這一次你將徹底掌握有限狀態機。源碼解讀廢話不多說,我們直接上代碼。結構體首先 fsm 包定義了一個結構體 FSM 用來表示狀態機。 https://github.com/lRead more

⤋ Read More

Life-changing cataract surgery restores eyesight to hunt again
In the Top End, cataracts often go untreated for years, becoming dense and leathery. A roving surgery team is tackling the backlog and restoring sight to remote Indigenous patients. ⌘ Read more

⤋ Read More

golang 每日一庫之 bsm-redislock
bsm/redislock 是一個用於 在 Go 語言中實現基於 Redis 的分佈式鎖(distributed lock) 的開源庫,由 bsm 組織開發和維護。它實現了基於 Redis 的 SET NX PX 命令模式的分佈式鎖,兼容 Redlock 算法的核心思想,但更簡單和輕量。簡介–基於 Redis 單實例實現分佈式鎖 遵循 Redis 官方推薦的 SET resource-na ⌘ Read more

⤋ Read More

golang 每日一庫之 bsm-redislock
bsm/redislock 是一個用於 在 Go 語言中實現基於 Redis 的分佈式鎖(distributed lock) 的開源庫,由 bsm 組織開發和維護。它實現了基於 Redis 的 SET NX PX 命令模式的分佈式鎖,兼容 Redlock 算法的核心思想,但更簡單和輕量。簡介–基於 Redis 單實例實現分佈式鎖 遵循 Redis 官方推薦的 SET resource-na ⌘ Read more

⤋ Read More

go 實現 - 性能逆天又免費的 IoT 開發神器 —
它解決了什麼痛點? 物聯網的開發往往讓人抓狂——設備協議不兼容、數據格式亂七八糟、傳輸不穩定,還得擔心安全問題和擴展性。Magistrala IoT 平臺正是以此爲背景,爲開發者打造了一個安全、高效、兼容性強且高度擴展的免費開源平臺,讓設備溝通、數據管理變得簡單可靠,從而輕鬆實現規模化部署。Magistrala IoT 是什麼? Magistrala IoT(由 Abstract Machin ⌘ Read more

⤋ Read More

go 實現 - 性能逆天又免費的 IoT 開發神器 —
它解決了什麼痛點? 物聯網的開發往往讓人抓狂——設備協議不兼容、數據格式亂七八糟、傳輸不穩定,還得擔心安全問題和擴展性。Magistrala IoT 平臺正是以此爲背景,爲開發者打造了一個安全、高效、兼容性強且高度擴展的免費開源平臺,讓設備溝通、數據管理變得簡單可靠,從而輕鬆實現規模化部署。Magistrala IoT 是什麼? Magistrala IoT(由 Abstract Machin ⌘ Read more

⤋ Read More

golang 每日一庫之 goflow
goflow 是一個基於 Go 語言的高性能、可擴展、分佈式的工作流框架。它允許開發者以編程方式將分佈式工作流定義爲任務的有向無環圖(DAG),並通過多個工作節點(Worker)均勻分配負載來執行任務。核心特性—-1. DAG 構建與任務編排goflow 允許用戶以 DAG 的形式定義工作流,每個節點代表一個任務,邊表示任務之間的依賴關係。這種結構使得任務的執行順序清晰,便於管理複雜的工作流程 ⌘ Read more

⤋ Read More

golang 每日一庫之 goflow
goflow 是一個基於 Go 語言的高性能、可擴展、分佈式的工作流框架。它允許開發者以編程方式將分佈式工作流定義爲任務的有向無環圖(DAG),並通過多個工作節點(Worker)均勻分配負載來執行任務。核心特性—-1. DAG 構建與任務編排goflow 允許用戶以 DAG 的形式定義工作流,每個節點代表一個任務,邊表示任務之間的依賴關係。這種結構使得任務的執行順序清晰,便於管理複雜的工作流程 ⌘ Read more

⤋ Read More

[$] Block-layer bounce buffering bounces out of the kernel
As the end of the 1990s approached, a lot of kernel-development effort was
going into improving support for 32-bit systems
with shockingly large amounts of memory installed. This being the 1990s,
having more than 1GB of memory in such a system was deemed to be shocking.
Many of the compromises made to support such inconceivably large systems
have remained in the kernel to this day. One of those compromises —
bounce buffering of I/O requests in the block layer — has finally be … ⌘ Read more

⤋ Read More

Local vulnerabilities in Kea DHCP
The SUSE Security Team has published a detailed\
report about security vulnerabilities it discovered in the Kea DHCP server suite from the Internet Systems Consortium
(ISC).

Since SUSE is also going to ship Kea DHCP in its products, we
performed a routine review of its code base. Even before checking the
network security of Kea, we stumbled over a range of local securit … ⌘ Read more

⤋ Read More

TypeScript 推出原生 Go 編譯器,速度提升 10 倍
微軟 TypeScript 宣佈推出 TypeScript Native 原生預覽版,使用原生語言 Go 重寫編譯器,替代原有 Node.js 版的編譯器,編譯速性能高達到了 10 倍以上。TypeScript 相當於 JavaScript 的超集,加入了靜態類型檢查,大大提高了代碼安全和可維護性,現在很多桌面應用都是用 TypeScript 開發的,包括 VScode。隨着很多項目都是雲原生、A ⌘ Read more

⤋ Read More

golang 每日一庫之 go-workflow
go-workflow 是一個基於 Go 語言開發的超輕量級工作流引擎,設計靈感來源於 Java 的 Activiti,但進行了深度簡化和解耦,特別適用於微服務架構下的流程控制需求。特點微服務架構友好 :go-workflow 僅關注流程流轉邏輯,完全解耦用戶、組織等業務數據,便於與各類系統集成。 JSON 流程定義 :採用 JSON 數組替代傳統的 BPMN 模 ⌘ Read more

⤋ Read More

golang 每日一庫之 go-workflow
go-workflow 是一個基於 Go 語言開發的超輕量級工作流引擎,設計靈感來源於 Java 的 Activiti,但進行了深度簡化和解耦,特別適用於微服務架構下的流程控制需求。特點微服務架構友好 :go-workflow 僅關注流程流轉邏輯,完全解耦用戶、組織等業務數據,便於與各類系統集成。 JSON 流程定義 :採用 JSON 數組替代傳統的 BPMN 模 ⌘ Read more

⤋ Read More

golang 每日一庫之 redsync
redsync 是一個用 Go 編寫的分佈式互斥鎖(Distributed Mutex)庫,基於 Redis 實現。其主要目標是在分佈式系統中爲多個進程或服務之間提供互斥訪問的機制,確保同一時間內只有一個客戶端可以訪問共享資源。核心功能—-redsync 實現了 Redlock 算法(由 Redis 創始人 antirez 提出),該算法旨在在分佈式環境中實現安全、健壯的鎖。基本原理使用多個獨 ⌘ Read more

⤋ Read More

golang 每日一庫之 redsync
redsync 是一個用 Go 編寫的分佈式互斥鎖(Distributed Mutex)庫,基於 Redis 實現。其主要目標是在分佈式系統中爲多個進程或服務之間提供互斥訪問的機制,確保同一時間內只有一個客戶端可以訪問共享資源。核心功能—-redsync 實現了 Redlock 算法(由 Redis 創始人 antirez 提出),該算法旨在在分佈式環境中實現安全、健壯的鎖。基本原理使用多個獨 ⌘ Read more

⤋ Read More

在 Go 中如何使用有限狀態機優雅解決程序中狀態轉換問題
在編程中,有限狀態機(FSM)是管理複雜狀態流轉的優雅工具,其核心在於通過明確定義狀態、事件和轉換規則,將業務邏輯模塊化。本文將探討在 Go 中如何使用有限狀態機。有限狀態機在介紹有限狀態機之前,我們可以先來看一個示例程序: https://github.com/jianghushinian/blog-go-example/blob/main/fsm/main.gopackage mainimpRead more

⤋ Read More

在 Go 中如何使用有限狀態機優雅解決程序中狀態轉換問題
在編程中,有限狀態機(FSM)是管理複雜狀態流轉的優雅工具,其核心在於通過明確定義狀態、事件和轉換規則,將業務邏輯模塊化。本文將探討在 Go 中如何使用有限狀態機。有限狀態機在介紹有限狀態機之前,我們可以先來看一個示例程序: https://github.com/jianghushinian/blog-go-example/blob/main/fsm/main.gopackage mainimpRead more

⤋ Read More

prologic@JamessMacStudio
Sun May 25 21:44:41
~/tmp/neurog
 (main) 130
$ go build ./cmd/ttt/... && ./ttt
Generation  27 | Fitness: 0.486111 | Nodes: 44  | Conns: 82

… experimenting with building and training a tic-tac-toe game, which evolves a. neural net that learn to paly the game against the best evolved champions 😅

⤋ Read More
In-reply-to » @bender Here's a short-list:

@prologic@twtxt.net I remember going through your “introduction to Golang”, I don’t remember the URL, but I vividly remember going through it, and I was lost at chapter one. So, about that “mastering” the core in hours, “I don’t believe you.” (insert I don’t believe you meme animated GIF here). LOL.

⤋ Read More
In-reply-to » @kat I don’t like Golang much either, but I am not a programmer. This little site, Go by example might explain a thing or two.

Ultimately, Go sits in the sweet spot on the complexity vs performance chart:

  • Minimal syntax & concepts → low learning curve
  • Compiled speed → high throughput
  • Built-in CSP concurrency → scalable by default

See Rob Pyke’s presentation on Expressiveness of Go

⤋ Read More
In-reply-to » @kat I don’t like Golang much either, but I am not a programmer. This little site, Go by example might explain a thing or two.

One of the nicest things about Go is the language itself, comparing Go to other popular languages in terms of the complexity to learn to be proficient in:

⤋ Read More
In-reply-to » @kat I don’t like Golang much either, but I am not a programmer. This little site, Go by example might explain a thing or two.

@bender@twtxt.net Here’s a short-list:

  • Simple, minimal syntax—master the core in hours, not months.
  • CSP-style concurrency (goroutines & channels)—safe, scalable parallelism.
  • Blazing-fast compiler & single-binary deploys—zero runtime dependencies.
  • Rich stdlib & built-in tooling (gofmt, go test, modules).
  • No heavy frameworks or hidden magic—unlike Java/C++/Python overhead.

⤋ Read More
In-reply-to » i wish it was realistic for me to learn golang but every single time i try to comprehend any go code i'm like What the fuck am i looking at. why is all of this so short and condensed GIVE ME VERBOSE CODE

@movq@www.uninformativ.de i feel like when i read go code i’m reading some algebra shit where every part is 1-5 letters long and then there’s weird symbols like := and it’s just infinitely harder for me to parse and infer meaning from lol. it’s such a me problem

⤋ Read More

i wish it was realistic for me to learn golang but every single time i try to comprehend any go code i’m like What the fuck am i looking at. why is all of this so short and condensed GIVE ME VERBOSE CODE

⤋ Read More
In-reply-to » Over the past few weeks I've been experimenting with and doing some deep learning and researching into neutral networks and evolutionary adaptation of them. The thing is I haven't gotten very far. I've been able to build two different approaches so far with limited results. The frustrating part is that these things are so "random" it isn't even funny. Like I can't even get a basic ANN + GA to evolve a network that solves the XOR pattern every time with high levels of accuracy. 😞

This is one of my attempts:

$ go build ./cmd/xor/... && ./xor
Generation  95 | Fitness: 0.999964 | Nodes: 9   | Conns: 19
Target reached!

Best network performance:
  [0 0] → got=0 exp=0 (raw=0.000) ✅
  [0 1] → got=1 exp=1 (raw=0.990) ✅
  [1 0] → got=1 exp=1 (raw=0.716) ✅
  [1 1] → got=0 exp=0 (raw=0.045) ✅
Overall accuracy: 100.0%
Wrote best.dot – render with `dot -Tpng best.dot -o best.png`

⤋ Read More

一文了解 JWT Token
在實際開發中,使用令牌認證,還有其他很多好處。掌握令牌認證的原理和實現方法,是 Go 語言開發者,必備的核心技能之一。由於 miniblog 使用 JWT Token 進行身份認證,爲了降低學習難度併爲後續代碼實現奠定基礎,本節課將介紹 JWT 的核心內容。JWT 認證流程——–學習 JWT 的最佳方式是通過其認證流程理解其原理。認證流程如下圖所示。上圖展示了 JWT 的認證流程,具體流 ⌘ Read more

⤋ Read More

API 設計的 “Go 境界”:Go 團隊設計 MCP SDK 過程中的取捨與思考
大家好,我是 Tony Bai。作爲開發者,我們每天都在與 API 打交道——調用它們,設計它們,有時也會爲糟糕的 API 設計而頭痛不已。一個優秀的 API,如同一位技藝精湛的嚮導,能清晰、高效地引領我們通往復雜功能的彼岸;而一個蹩腳的 API,則可能像一座佈滿陷阱的迷宮,讓我們步履維艱。那麼,在 Go 語言的世界裏,一個 “好” 的 API 應該是什麼樣子的?它應該如何體現 Go 語言簡潔、高 ⌘ Read more

⤋ Read More

API 設計的 “Go 境界”:Go 團隊設計 MCP SDK 過程中的取捨與思考
大家好,我是 Tony Bai。作爲開發者,我們每天都在與 API 打交道——調用它們,設計它們,有時也會爲糟糕的 API 設計而頭痛不已。一個優秀的 API,如同一位技藝精湛的嚮導,能清晰、高效地引領我們通往復雜功能的彼岸;而一個蹩腳的 API,則可能像一座佈滿陷阱的迷宮,讓我們步履維艱。那麼,在 Go 語言的世界裏,一個 “好” 的 API 應該是什麼樣子的?它應該如何體現 Go 語言簡潔、高 ⌘ Read more

⤋ Read More

自制 ResponseWriter:Go 安全 HTTP
Go 的 http.ResponseWriter 會直接向套接字(socket)寫入數據,這可能會導致一些隱蔽的 bug,例如忘記設置狀態碼,或是在爲時已晚的時候意外修改了響應頭(header)。本文將展示如何通過包裝 ResponseWriter 來強制執行自定義規則,例如要求 WriteHeader() 以及在出錯後阻止寫入操作,從而讓你的處理器(handler)更安全、也更易於梳理邏輯。我用 ⌘ Read more

⤋ Read More

自制 ResponseWriter:Go 安全 HTTP
Go 的 http.ResponseWriter 會直接向套接字(socket)寫入數據,這可能會導致一些隱蔽的 bug,例如忘記設置狀態碼,或是在爲時已晚的時候意外修改了響應頭(header)。本文將展示如何通過包裝 ResponseWriter 來強制執行自定義規則,例如要求 WriteHeader() 以及在出錯後阻止寫入操作,從而讓你的處理器(handler)更安全、也更易於梳理邏輯。我用 ⌘ Read more

⤋ Read More

Go 語言實現優雅關機和重啓的示例很詳細
在生產環境中,服務的更新和維護是不可避免的。粗暴地終止服務會導致:正在處理的請求被中斷 數據庫事務未完成 緩存數據丟失 客戶端連接異常 本文將深入探討如何使用 Go 語言實現:優雅關機 :等待現有請求完成後再關閉服務 優雅重啓 :無縫切換新舊進程,實現零停機更新 優雅關機實現核心機制完整實現代碼package mainimport(” ⌘ Read more

⤋ Read More

Go 語言實現優雅關機和重啓的示例很詳細
在生產環境中,服務的更新和維護是不可避免的。粗暴地終止服務會導致:正在處理的請求被中斷 數據庫事務未完成 緩存數據丟失 客戶端連接異常 本文將深入探討如何使用 Go 語言實現:優雅關機 :等待現有請求完成後再關閉服務 優雅重啓 :無縫切換新舊進程,實現零停機更新 優雅關機實現核心機制完整實現代碼package mainimport(” ⌘ Read more

⤋ Read More

Gin 服務性能提升的最佳實踐
Gin 框架是在 Go 中構建網絡服務的首選。隨着應用程序複雜性和流量的增加,性能成爲不能忽視的因素。本文將介紹一系列使用 Gin 構建服務的有效技巧,涵蓋從路由優化到內存重用、請求和響應優化、異步處理以及性能分析,幫助你創建更穩定高效的 Web 服務。路由註冊優化:避免循環引用————-Gin 的路由器使用基於樹的高效路由實現,可以快速匹配請求路徑。但是,如果路由註冊不當,例如嵌 ⌘ Read more

⤋ Read More

Gin 服務性能提升的最佳實踐
Gin 框架是在 Go 中構建網絡服務的首選。隨着應用程序複雜性和流量的增加,性能成爲不能忽視的因素。本文將介紹一系列使用 Gin 構建服務的有效技巧,涵蓋從路由優化到內存重用、請求和響應優化、異步處理以及性能分析,幫助你創建更穩定高效的 Web 服務。路由註冊優化:避免循環引用————-Gin 的路由器使用基於樹的高效路由實現,可以快速匹配請求路徑。但是,如果路由註冊不當,例如嵌 ⌘ Read more

⤋ Read More

代碼覆蓋率新玩法:Russ Cox 教你用差異化分析加速 Go 調試
大家好,我是 Tony Bai。調試,尤其是調試並非自己編寫的代碼,往往是軟件開發中最耗時的環節之一。面對一個失敗的測試用例和龐大的代碼庫,如何快速有效地縮小問題範圍?Go 團隊的前技術負責人 Russ Cox 近期分享了一個雖然古老但極其有效的調試技術——差異化覆蓋率 (Differential Coverage)。該技術通過比較成功和失敗測試用例的代碼覆蓋率,巧妙地 “高亮” 出最可能包含 B ⌘ Read more

⤋ Read More

代碼覆蓋率新玩法:Russ Cox 教你用差異化分析加速 Go 調試
大家好,我是 Tony Bai。調試,尤其是調試並非自己編寫的代碼,往往是軟件開發中最耗時的環節之一。面對一個失敗的測試用例和龐大的代碼庫,如何快速有效地縮小問題範圍?Go 團隊的前技術負責人 Russ Cox 近期分享了一個雖然古老但極其有效的調試技術——差異化覆蓋率 (Differential Coverage)。該技術通過比較成功和失敗測試用例的代碼覆蓋率,巧妙地 “高亮” 出最可能包含 B ⌘ Read more

⤋ Read More

[$] LWN.net Weekly Edition for May 22, 2025
Inside this week’s LWN.net Weekly Edition:

  • Front: Home Assistant; Setuptools; Debian AI GR; DMA-mapping API; BPF CI; OSPM 2025

  • Briefs: Go audit; Oniux; Asahi progress; Rust in FreeBSD; RHEL 10; Rust 1.87.0; RIP John L. Young; Quote; …

  • Announcements: Newsletters, conferences, security updates, patches, and more. ⌘ Read more

⤋ Read More