Searching We.Love.Privacy.Club

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

Golang 編譯:靜態鏈接和動態鏈接
本文介紹了 Go 語言中靜態鏈接和動態鏈接的概念,解釋了它們的區別和各自優勢。通過示例,展示瞭如何生成靜態或動態鏈接的二進制文件,以及使用工具進行檢查。文章還討論了內部和外部鏈接器的區別,如何在編譯時選擇鏈接方式,以及在交叉編譯時處理 cgo 的方法。最後,提到了減小二進制文件大小的技巧和安全性方面的考慮。概述–Go 語言最大的優勢之一就是它的編譯器,它爲程序員抽象了許多細節,讓你可以輕鬆地爲幾 ⌘ Read more

⤋ Read More

After testing Vivaldi for a couple of weeks I am convinced this is a great browser and to support the team behind it, I decided to start sending them a couple of Euro monthly, just to keep the momentum going.

⤋ Read More

Go 語言 bufio 包入門:10 分鐘掌握高性能 I-O 操作
大家好,今天我們來聊一個 Go 語言中非常實用的包 - bufio。不管你是剛入門的新手還是有經驗的開發者,這篇文章都能幫你快速掌握 bufio 的使用!🌟 什麼是 bufio?————-bufio 是 Go 語言提供的一個帶緩衝的 I/O 包,它像是給 I/O 操作加了一個 “加速器”,通過減少系統調用次數來提升性能。想象一下:不用緩衝:每次讀寫都直接操作硬盤,就像我們一次只買一 ⌘ Read more

⤋ Read More

Golang 解釋器:Yaegi 內部實現
Yaegi[2]  是一個用 Go 語言編寫的 Go 語言解釋器。這個項目最初是在 Traefik-Labs 啓動的, 目的是爲 traefik 反向代理提供一個簡單實用的嵌入式插件引擎。現在, 社區貢獻的 200 多個插件已經列在  plugins.traefik.io[3]  的公共目錄中。Yaegi 的使用也擴展到其他領域, 例如 數據庫 [4] 、 可觀察性 [5] 、 容器安全 [6] ⌘ Read more

⤋ Read More

完全用 Go 編寫的 JS 引擎
背景介紹隨着互聯網技術的迅猛發展,JavaScript 已經成爲幾乎所有現代網頁和應用開發中不可或缺的組成部分。但是,JavaScript 的執行環境通常侷限於瀏覽器或者 Node.js,這爲那些希望在不同環境下運行 JavaScript 代碼的開發者帶來了限制。特別是在 Go 語言環境中,開發者面臨着將 JavaScript 與 Go 通信的挑戰,因爲二者運行時不一致可能導致性能下降和開發效率降 ⌘ Read more

⤋ Read More

萬字長文講透 Go 程序性能優化
性能分析和優化是所有軟件開發人員必備的技能,也是後臺大佬們口中津津樂道的話題。Golang 作爲一門 “現代化” 的語言,原生就包含了強大的性能分析工具 pprof 和 trace。pprof 工具常用於分析資源的使用情況,可以採集程序運行時的多種不同類型的數據(例如 CPU 佔用、內存消耗和協程數量等),並對數據進行分析聚合生成的報告。trace 工具則關注程序運行時的事件(例如協程狀態切換,G ⌘ Read more

⤋ Read More

Go 中祕而不宣的數據結構 BitVec:位向量 125MB 存儲 10 億個數據
位圖 (bitmap) 是一種優雅而高效的數據結構, 它巧妙地利用了計算機最底層的位運算能力。你可以把它想象成一個巨大的開關陣列, 每個開關只有打開和關閉兩種狀態 —— 這就是位圖的本質。每一位都可以獨立控制, 卻又可以通過位運算實現羣體操作。在實際應用中, 位圖的威力令人驚歎。設想你需要在海量數據中查找重複的數字, 傳統的哈希表或數組都會佔用大量內存。而位圖卻能巧妙地用一個比特位標記一個數字的 ⌘ Read more

⤋ Read More

一個比較 tricky 的 Golang 問題: 最大協程數量
在 Go 語言面試中, 關於 “可以產生的最大協程數量” 這個問題有時會讓候選人措手不及。答案並不是簡單地給出一個具體數字。面試官通常用這個問題來評估你對 Go 併發模型、內存管理以及協程實踐經驗的理解。理解 Go 的併發模型和協程效率首先需要明確以下幾點:協程是由 Go 運行時管理的輕量級用戶空間線程, 比傳統的操作系統線程更高效 Go 並沒有對協程數量設置嚴格限制, 在合適的條件下, 你可以同 ⌘ Read more

⤋ Read More

5 Helpful Uses for Apple Intelligence on Mac, iPhone, & iPad
Apple Intelligence is here on Mac, iPhone, and iPad, and while the system requirements are strict, the Apple devices that are new and powerful enough to use the AI tools now gain some really fantastic features. We’re going to show you six helpful Apple Intelligence features and uses that you’ll find beneficial to your workflow, … [Read More](https://osxdaily.com/2024/11/04/5-helpful-uses-for-apple-intelligence-o … ⌘ Read more

⤋ Read More

10 個最佳 Golang 庫
10 個最佳 Golang 庫—————在 Golang 中,我們可以找到垃圾回收、可接受的庫和標準的類型系統。Golang 適用於系統編程,也被稱爲包。Go 語言被稱爲 Golang 是因爲它在編程語言 GO 中收集了一些可重用的代碼組件。在 Go 語言中,包在組織和結構化代碼方面起着重要作用,還提高了可讀性、代碼可重用性和可維護性。這裏爲你介紹十個最佳 Golang 庫。這 ⌘ Read more

⤋ Read More

一個小例子,給你講透 Go 配置管理,輕鬆將其融入到項目中
在軟件開發中,配置管理是一個不可或缺的部分。無論是開發環境、測試環境還是生產環境,我們都需要一種方法來存儲和讀取配置信息。在 Golang 項目中,Viper 是一個非常流行且功能強大的庫,用於處理配置文件。下面我會寫一些例子,幫助大家快速上手。什麼是 Viper?———-不賣關子,直接上 GitHub 地址:https://github.com/spf13/viper 大家可以直接去 ⌘ Read more

⤋ Read More

Monero Tech meeting scheduled for 18 November 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, November 18 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:

Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.

This meeting’s c … ⌘ Read more

⤋ Read More

(#fmnhewq) Most of the time I think its the Go proxy I run. I wonder whether that thing is just a bit flakey perhaps? 🤔 I dunno, I’d need t …
Most of the time I think its the Go proxy I run. I wonder whether that thing is just a bit flakey perhaps? 🤔 I dunno, I’d need to invest some time standing up some kind of analytics so I can discover the pattern here. ⌘ Read more

⤋ Read More

Kubectl logs tail: a guide to tailing Kubernetes logs
Member post originally published on Middleware’s blog In the world of cloud-native applications, Kubernetes stands as the go-to platform for container orchestration (the automated process of managing, scaling, and maintaining containerized applications across multiple hosts). As applications grow… ⌘ Read more

⤋ Read More

**(#dn2zlga) @Codebuzz Here you go:

$ bat https://twtxt.net/twt/dn2zlga | jq '.'
{
  "twter": {
    "nick": "Codebuzz",
    "uri": "https://w ...**
[@Codebuzz _@www.codebuzz.nl_](https://twtxt.net/external?uri=https://www.codebuzz.nl/twtxt.txt&nick=Codebuzz) Here you go:

$ bat https://twtxt.net/twt/dn2zlga | jq ‘.’
{
“twter”: {

"nick": "Codebuzz",
"uri": "https://www.codebuzz.nl/twtxt.txt",
"avatar": "https://www.codebuzz.nl/twtxt-avatar-800.jpg"

},
“text”: “(#q5rg3ea) Hey, @ I know. Just … ⌘ Read more

⤋ Read More

Golang 隨機公平庫 satmihir-fair
FAIR 是一個 Go 庫, 旨在確保資源受限環境中的公平性。它有助於在資源短缺時將有限的資源 (例如數據庫 / blob 存儲吞吐量、作業執行資源等) 均勻分配給多個客戶端, 防止基於客戶端行爲的過度分配和飢餓。 簡介–FAIR 的核心算法基於 隨機公平 BLUE[1] , 這種算法通常用於網絡擁塞控制, 但做了一些修改。FAIR 的理念是隻在真正資源短缺時進行限制, 而不是像令牌桶或漏桶等 ⌘ Read more

⤋ Read More

構建無密碼認證:passkey 入門與 Go 實現
傳統的密碼認證一直以來都是數字時代的主流身份驗證方式。然而,用戶常常選擇易記的弱密碼並重復使用,導致賬號易受攻擊。密碼泄露、釣魚攻擊等安全問題層出不窮,超過 80% 的數據泄露與密碼相關。與此同時,頻繁的密碼管理和忘記密碼情況嚴重影響用戶體驗。服務商在安全保存用戶密碼方面的責任也增加了系統建設和維護的成本。爲了應對這些問題,科技行業開始積極探索無密碼認證的方法。無密碼認證利用設備生物識別、硬件加密 ⌘ Read more

⤋ Read More

SwarmGo:一個用於構建可擴展 AI Agent 工作流的 Go 模塊化框架
AI 領域正在快速發展,新的應用層出不窮。然而,創建能夠有效協調多個 AI 任務或 Agent(每個 Agent 處理複雜工作流的一部分)的系統仍然具有挑戰性。SwarmGo 應運而生,這是一個功能強大且輕量級的 Go 包,旨在使 AI 應用中的 Agent 編排更易於訪問和擴展。本文將深入探討 SwarmGo 的特性、優勢和結構,並展示如何使用它輕鬆創建智能的模塊化 AI 工作流。什麼是 Swa ⌘ Read more

⤋ Read More

解密 Go runtime-SetFinalizer 的使用
如果我們想在對象 GC 之前釋放一些資源,可以使用 returns.SetFinalizer。這就像在函數返回前執行 defer 來釋放資源一樣。例如:1:使用 runtime.SetFinalizertype MyStruct struct {       Name  string       Other MyStruct   }  func main() {       x := MyStru ⌘ Read more

⤋ Read More

**(#gctrz4q) @falsifian Only that this rendering behavior comes from yarnd’s Markdown parser library that is used:

What has text/markdown go …**
@falsifian @www.falsifian.org Only that this rendering behavior comes from yarnd’s Markdown parser library that is used:

What has text/markdown got to do with this? I don’t think Markdown says anything about replacing ¼ with ¼, or other similar transformations. It’s not needed, because ¼ is already a … ⌘ Read more

⤋ Read More

使用 Go 構建分佈式系統:基於 gRPC 的主從節點架構
在現代軟件開發領域,分佈式系統已經變得至關重要。它們使服務能夠擴展、處理大量數據並提供高可用性。本文將指導您使用 Golang 構建一個簡單的分佈式系統,該系統利用主節點和單個工作節點,並使用 gRPC 協議進行通信。這種架構非常適合數據處理、並行計算和大規模處理工作負載等分佈式任務。我們將介紹如何設置主從結構、建立基於 gRPC 的通信,以及實現簡單的任務分配和執行流程。系統概述—-我們的分 ⌘ Read more

⤋ Read More

Golang 常用的五種創建型設計模式
在 Go 中,創建設計模式有助於管理對象的創建,並控制對象的實例化方式。這些模式在對象創建過程複雜或需要特殊處理時特別有用。以下是 Go 中常用的主要創建模式:單例模式單例模式確保一個類只有一個實例,並提供一個全局訪問點。如何實現定義一個結構,並將其作爲單個實例。 爲該結構創建一個全局變量,但不要立即將其初始化。 使用 sync.Once 確保實例只創建一次,即使在多線程情況下也是如此 ⌘ Read more

⤋ Read More

Neycer Robalino vs Hayden Green – Brisbane Flexi Season (Week 3) Div 1 Final - YouTube This is Neycer one of our coaches at the table-tenn …
Neycer Robalino vs Hayden Green – Brisbane Flexi Season (Week 3) Div 1 Final - YouTube

This is Neycer one of our coaches at the table-tennis club 🏓 that I play at vs. Hayden a top-rated QLD player ( well not anymore 🤣). What a match! 😱 Go #Brisbane [#Table-Tennis](https://twtxt.net/search?q=tags:Table … ⌘ Read more

⤋ Read More

Go 中祕而不宣的數據結構 Treap:平衡樹不一定就用紅黑樹
treap 是一棵二叉樹,它同時維護二叉搜索樹 (BST) 和堆的屬性, 所以由此得名 (tree + heap   ⇒  treap)。從形式上講,treap (tree + heap) 是一棵二叉樹,其節點包含兩個值,一個  key  和一個  priority,這樣 key 保持 BST 屬性,priority 是一個保持 heap 屬性的隨機值(至於是最大堆還是最小堆並不重要)。相對於其 ⌘ Read more

⤋ Read More

Go 語言的組合之道
在軟件開發領域,”組合優於繼承” 的原則常常被奉爲圭臬,因爲它能夠帶來更靈活、更易維護的代碼。Go 語言以其獨特的面對對象設計理念,堅定地選擇了組合而非繼承。本文將深入探討 Go 語言爲何偏愛組合,並闡述其在實際應用中的優勢。繼承的弊端與組合的優勢———–傳統的面對對象編程語言通常依賴繼承機制,允許一個類繼承另一個類的行爲和屬性。然而,這種方式容易導致代碼結構僵化,難以應對需求變化。 ⌘ Read more

⤋ Read More

Monero Tech meeting scheduled for 4 November 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, November 4 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:

Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.

This meeting’s chai … ⌘ Read more

⤋ Read More

**(#rjapt4a) I think it uses the first # url too. See here and here – @xuu@xuu Can you confirm this to be the case? 🙏 GetN("url", ...** I _think_ it uses the first# urltoo. See [here](https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/ast.go#L1062-L1074) and [here](https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/lextwt.go#L88-L95) – [@xuu _@txt.sour.is_](https://twtxt.net/external?uri=https://txt.sour.is/user/xuu/twtxt.txt&nick=xuu) Can you confirm this to be the case? 🙏GetN(“url”, 0)will return the fir ... ⌘ [Read more](https://twtxt.net/twt/5ieybsq)

⤋ Read More

My very strong opinion on the use of Twtxt is if you intend to use it, you should be prepared to let people pull your feed or at least check it …
My very strong opinion on the use of Twtxt is if you intend to use it, you should be prepared to let people pull your feed or at least check it and regular rentals.

Otherwise get out and go use something that’s either a distributed (Mastodon, AT, etc) or centralized (Facebook, X, etc) network. ⌘ Read more

⤋ Read More

After the behaviour of a clearly very angry feed author over the past few days, I’m very tempted to give up on Twtxt and allow it to go back to …
After the behaviour of a clearly very angry feed author over the past few days, I’m very tempted to give up on Twtxt and allow it to go back to being dead. What really is the point of building and supporting a way to exchange little pieces of text with one another in a completely decentralised way, if you’re just going to keep humping up against such hostility? I don’t know why I do this any … ⌘ Read more

⤋ Read More

依賴注入:讓 Go 語言更加優雅
依賴注入:讓 Go 語言更加優雅—————-在軟件工程中,依賴注入(Dependency Injection,簡稱 DI)是一種設計模式,它允許我們在不修改類的代碼的情況下向類中注入依賴。這種方式有助於降低代碼間的耦合度,使得各個組件更容易獨立開發和測試。雖然 Go 語言以其簡潔和高效的特性著稱,但在構建大規模應用時,手動管理依賴關係可能會變得複雜和難以維護。這就是 Pa ⌘ Read more

⤋ Read More

從 Go channel 中如何批量讀取數據 ?
在 Go 語言中,我們可以利用 channel 作爲數據的傳輸通道,通過定期批量讀取 channel 中的數據,並將這些數據批量發送到 Kafka 或者進行網絡寫入。這樣可以提高系統的性能,減少單個請求的網絡開銷。批量處理的主要邏輯是:從 channel 中接收數據,積累到一定數量或者達到時間限制後,將數據批量處理(例如發送到 Kafka 或者寫入網絡)。下面我將展示一個從 Go channel ⌘ Read more

⤋ Read More

解析 Golang sync-Once 用法和原理
Once is an object that will perform exactly one action.sync.Once 是 Go 標準庫提供的使函數只執行一次的實現,常應用於單例模式,例如初始化配置、保持數據庫連接等。它可以在代碼的任意位置初始化和調用,因此可以延遲到使用時再執行,併發場景下是線程安全的。對外接口Once 對外僅暴露了唯一的方法 Do(f func()),f 爲需要執行的 ⌘ Read more

⤋ Read More

Go 語言的 RSA 加密與解密:方法與最佳實踐
一般對接過支付業務的都知道,RSA 算法。RSA 是一種廣泛應用於安全通信領域的非對稱加密算法。它使用一對密鑰(公鑰和私鑰)來加密和解密數據,在互聯網通信、數字簽名等場景中具有重要作用。咱們一起看一下,在 Go 語言中,如何使用 RSA 算法。一、RSA 加密與解密的基礎知識1. 非對稱加密RSA 屬於非對稱加密算法,主要特點是密鑰成對使用:一個用於加密(公鑰),另一個用於解密(私鑰)。使用公鑰加 ⌘ Read more

⤋ Read More

Go 邏輯分支優化實戰
TL;DR通過函數式編程和 map 結構可以優化複雜的 if-else 邏輯 提前返回可以避免不必要的資源消耗,防止全表掃描等問題 避免在循環中使用 defer 語句,可能導致資源泄露 使用 for 循環對相同邏輯進行壓縮,提高代碼的簡潔性和可擴展性 代碼的世界,將自然語言的需求轉換成執行的邏輯。如何轉化成代碼之後仍然儘可能接近自然語言的可理解性,是我們一直探求的內容。 ⌘ Read more

⤋ Read More

探索 Go slog 標準庫:設計與應用
本文主要介紹了 Go 語言新引入的 log/slog 標準庫的設計理念、使用方法以及如何進行定製化開發,以提高日誌操作的性能和靈活性。原文: Explore the Go slog Standard Library: Design and Usage[1]在 Go1.21[2] 中引入的 log/slog[3] 軟件包試圖彌補原有日誌軟件包的不足,即日誌缺乏結構化和級別特性。正如提案 [4] ⌘ Read more

⤋ Read More

揭祕 Go sync-Map 設計與實現
什麼是 sync.Map————我們都知道在 Go 語言中,普通的 Map 是非併發安全,併發讀寫時會 panic,sync.Map 則是官方庫提供的一種特殊的併發安全的映射類型,能保較高的性能的同時,還能保證併發安全。sync.Map 有以下幾個特點:sync.Map 特點併發安全: sync.Map 無需額外的鎖機制即可在多個 goroutine 中安全地進行讀寫操作。這對於高 ⌘ Read more

⤋ Read More

Go 項目使用 Makefile 構建版本信息完整教程
目錄結構我們以最小目錄結構爲例進行說明,如下這是我們此次示例的目錄結構。$ tree -L 3.├── main.go├── Makefile├── pkg│   └── version│       └── version.go├── README.md代碼內容主要有兩部分代碼,分別爲 main.go,內容如下:package mainimport (    ”eastMoney/pkg/ver ⌘ Read more

⤋ Read More

Go 語言實現高性能文本壓縮算法 Brotli
在信息爆炸的時代,數據如同洪流般湧現,如何高效地存儲和傳輸這些數據成爲了一項至關重要的技術挑戰。壓縮技術應運而生,它如同一位技藝精湛的魔術師,能夠將龐大的數據文件 “化繁爲簡”,在不損失信息或損失極少信息的情況下將其壓縮成更小的體積,從而節省存儲空間、提高傳輸效率。壓縮技術主要分爲兩大類:無損壓縮和有損壓縮。無損壓縮:顧名思義,這種壓縮方式能夠在解壓縮後完全恢復原始數據,不會造成任何信息損失。常見 ⌘ Read more

⤋ Read More

Go 中祕而不宣的數據結構 runq- 難怪運行時調度那麼好
首先,讓我們先來回顧 Go 運行時的 GPM 模型。這方面的介紹網上的資料都非常非常多了,但是我們也不妨回顧一下: GPM 模型中的 G 代表 goroutine。每個 goroutine 只佔用幾 KB 的內存, 可以輕鬆創建成千上萬個。G 包含了 goroutine 的棧、指令指針和其他信息, 如阻塞 channel 的等待隊列等。 P 代表 processor, 可以理解爲一個抽 ⌘ Read more

⤋ Read More