Searching txt.sour.is

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

Go 併發控制:sync-Map 詳解
我們知道,Go 中的 map 類型是非併發安全的,所以 Go 就在 sync 包中提供了 map 的併發原語 sync.Map,允許併發操作,本文就帶大家詳細解讀下 sync.Map 的原理。使用示例sync.Map 提供了基礎類型 map 的常用功能,使用示例如下:package mainimport (“fmt”“sync”)func main() {var s sync.Map// 存儲鍵值 ⌘ Read more

⤋ Read More

Notary Project announces Notation v1.3.0 and tspclient-go v1.0.0!
The Notary Project maintainers are thrilled to announce the latest releases, including notation v1.3.0, notation-go v1.3.0, notation-core-go v1.2.0 and tspclient-go v1.0.0! These new versions are production ready and have successfully completed a comprehensive security audit. Check… ⌘ Read more

⤋ Read More

Go 併發控制 Wait - Cancel
Wait 和 Cancel 兩種併發控制方式,在使用 Go 開發服務的時候到處都有體現,只要使用了併發就會用到這兩種模式。在 Go 語言中,分別有 sync.WaitGroup 和 context.Context 來實現這兩種模式。sync.WaitGroup 等待多個線程完成對於要等待 n 個線程完成後再進行下一步的同步操作的做法,使用 sync.WaitGroup 來等待一組事件:func m ⌘ Read more

⤋ Read More

Scientists used a computer to predict exactly when society will collapse
Lucy Devine,    -  LADBIBLE

_Stephan: I have been telling you, my readers, as well as anyone else who was interested and would listen that between 2040-2045 there was going to be a cataclysmic change in humanity’s cultures, including the United States. (See YouTube searching on my name, or my personal website, where you can hear or read me expoun … ⌘ Read more

⤋ Read More

‘So stupid!’ Prof. shares government threat to halt scientific studies mentioning ‘women’
David Edwards,  Staff Writer  -  Raw Story

_Stephan: Research to improve your healthcare, particularly if you are female, is under assault as part of the “Republican” coup being led by “emperor” Trump, his co-president Elon Musk, and the spineless “Republicans” in Congress. They are going to stop any funding of research that deals with promoting wellbei … ⌘ Read more

⤋ Read More

From finding to fixing: GitHub Advanced Security integrates Endor Labs SCA
The partnership between GitHub and Endor Labs enables application security engineers and developers to drastically reduce time spent on open source vulnerabilities, and gives them the tools to go from finding to fixing.

The post [From finding to fixing: GitHub Advanced Security integrates Endor Labs SCA](https://github.blog/security/from-finding-to-fixing-github-advanced-security-integrates … ⌘ Read more

⤋ Read More

Notes to the American People — and Government Workers — on How to Stop Trump
Brendan Ballou,  Former Federal Prosecutor and Contributing Writer  -  Politico

_Stephan: The only thing that is going to stop the authoritarian MAGAt coup which is underway is we ourselves. Please call or write your representative and both Senators and tell them your feelings about the coup, and ask them outright: What are you doing to stop the dismantlement of our democracy … ⌘ Read more

⤋ Read More

School district warns parents of border patrol agents boarding buses for citizenship check
David Edwards,  Senior Editor  -  Raw Story

_Stephan: Militarily armed U.S. Immigration and Customs Enforcement (ICE) agents are going into apartments in the Denver area to drag possible illegal immigrants out of their homes. Texas is warning parents, as this report describes, that agents may board school buses to check children for their citize … ⌘ Read more

⤋ Read More

(#ydmhcsa) @lyse@lyse @bender@bender The funny thing is, this person, is still trying to convince me to go to this thing. I don’t …
@lyse @lyse.isobeef.org @bender @twtxt.net The funny thing is, this person, is still trying to convince me to go to this thing. I don’t even know wut da fuq it is?! Do they smoke peace pipes or something? Is it a hooker joint or something?! I have no idea 🤷 ⌘ Read more

⤋ Read More

Go 併發 Bug 殺手鐧:如何正確處理 Goroutines 中的錯誤?
📌 引言—–你是否遇到過這樣的情況:明明 Goroutine 已經執行,但程序結果卻異常? 錯誤似乎消失了,日誌中卻找不到任何線索? Goroutine 發生 panic,主程序卻沒有任何反應? 這些問題的根本原因通常是 Goroutines 中的錯誤處理缺失。如果沒有正確捕獲和處理錯誤,Go 的併發機制可能會讓 Bug 變得難以察覺,甚至導致程序崩潰。本文將深入剖析 G ⌘ Read more

⤋ Read More

golang 每日一庫之 spf13-viper
spf13/viper 是一個非常流行的 Go 語言庫,主要用於處理應用程序的配置文件。它提供了一種靈活且強大的方式來讀取、解析和管理不同來源的配置數據,比如文件、環境變量、命令行參數等。Viper 以其簡潔、易用以及高度的可定製性在 Go 生態中廣受歡迎。1. Viper 的核心功能Viper 主要用於配置管理,它支持從不同來源加載配置、處理複雜的數據結構、以及提供對配置項的靈活訪問。以下是 V ⌘ Read more

⤋ Read More

在 Go 中如何將 [][]byte 轉爲 io-Reader ?
起因:在春節前的某一天,我在 ekit 項目的交流羣裏看到大明老師發了這樣一條消息: 各位大佬,問個小問題,有咩有誰用過 byte 轉爲 io.Reader 的東西?我以前搞過一次,但是我忘了是我手搓了一個實現,還是用的開源的,還是 SDK 自帶的並且大明老師還爲此開了一個 issue。看到這條消息,我想起了我在對 Go 還不太熟悉時,曾寫過一個 io.MultiReader 的實現(當時寫完了 ⌘ Read more

⤋ Read More

解密 Go 語言中的雙生函數:main– 與 init– 的隱祕世界
在 Go 語言的開發實踐中,main()和init()這兩個看似簡單的函數,承載着程序生命週期的核心邏輯。它們如同程序世界的守門人,一個負責搭建舞臺,另一個負責拉開帷幕。本文將通過深度剖析二者的差異,揭示它們在 Go 運行時系統中的運作機制,並提供多個完整代碼示例幫助開發者掌握正確使用姿勢。 函數本質與定位差異———main():程序的唯一入口main()函數是每個可執行 Go 程序的 ⌘ Read more

⤋ Read More

Go 項目裏的 API 對接,這樣做 Mock 測試才舒服
我們在開發項目的過程中總會遇到要調用依賴方接口的情況,如果依賴方的 API 接口還沒有開發好,通常我們會先約定好 API 接口的請求參數、響應結構和各類錯誤對應的響應碼,再按照約定好請求和響應進行開發。除了上面說的情況外,還有一種就是當你開發的功能需要與微信支付類的 API 進行對接時,因爲各種訂單、簽名、證書等的限制你在開發階段也不能直接去調用支付的 API 來驗證自己開發的程序是否能成功完成對 ⌘ Read more

⤋ Read More

Golang Option 模式看這一篇就夠了
在 Go 語言中,我們經常需要定義結構體,並通過構造函數初始化它們。然而,Go 不支持默認參數,如果一個結構體有很多可選參數,我們會面臨以下問題:構造函數參數過長,調用時不夠直觀。 需要維護多個 NewXXX 函數,擴展性較差。 代碼可讀性降低。 爲了解決這個問題,Golang 社區廣泛採用 Option 模式,讓我們可以優雅地管理可選參數。本文將詳細講解 Option 模式的 ⌘ Read more

⤋ Read More
In-reply-to » @bender @prologic I can reproduce this locally, too. But it doesn't matter if I follow the feed or not. With JS enabled, hitting "Reply" opens a textarea with @<url>. Submitting this writes @<domain url> instead of @<nick url> in the feed.

While I now have a somewhat working fix for it in yarnd (https://git.mills.io/yarnsocial/yarn/pulls/1232), I also have the feeling that I should fix literal formatting in lextwt as well. This also uncovered more bugs I believe: https://git.mills.io/yarnsocial/go-lextwt/pulls/28

But then there is also the question why the textarea is populated with @<url> in the first place rather than @<nick url> or yarnd’s own @nick@domain/@nick syntax. It indeed has to do something with whether I follow the mentioned feed or not.

Anyway, something to investigate for future Lyse or maybe @prologic@twtxt.net and/or @xuu@txt.sour.is. G’night!

⤋ Read More
In-reply-to » @bender @prologic I can reproduce this locally, too. But it doesn't matter if I follow the feed or not. With JS enabled, hitting "Reply" opens a textarea with @<url>. Submitting this writes @<domain url> instead of @<nick url> in the feed.

Righto, must be some caching thing that’s going on, too. Now, with JS enabled and a feed that I follow, hitting “Reply” actually automatically enters @nick@domain in the textarea. Submitting it correctly writes “@in the feed. Let's dig…

⤋ Read More
In-reply-to » Every time I go to the office, I get nothing done. Unbelievable.

@movq@www.uninformativ.de So true! Either I’m hanging around with my direct teammates socializing in person in a meeting room or some other workmates are making so much noise in the open-plan office that I cannot concentrate at all. In any case, completely unproductive. :-D Luckily, I very rarely have to go to the office.

⤋ Read More

基於 Go 語言構建高性能併發鍵值存儲
在分佈式系統和高併發場景中,鍵值存儲(Key-Value Store)作爲基礎組件扮演着至關重要的角色。本文將通過 Go 語言實現一個線程安全的併發鍵值存儲系統,深入探討其設計原理、性能優化策略以及實際應用場景。 爲什麼選擇 Go 語言?————Go 語言憑藉其原生的併發模型(goroutine 和 channel)、高效的內存管理以及簡潔的語法,成爲構建高性能併發系統的理想選擇。 ⌘ Read more

⤋ Read More

Go channel 計數信號量
Go 併發設計的一個慣用法就是將帶緩衝 channel 用作計數信號量(counting semaphore)。帶緩衝 channel 中的當前數據個數代表的是當前同時處於活動狀態(處理業務)的 goroutine 的數量,而帶緩衝 channel 的容量(capacity)就代表了允許同時處於活動狀態的 goroutine 的最大數量。向帶緩衝 channel 的一個發送操作表示獲取一個信號量, ⌘ Read more

⤋ Read More

在 Go 中實現 TOTP 認證:實踐指南
時間性一次性密碼(TOTP)已成爲現代應用中實現雙因素認證(2FA)的標準。在本指南中,我們將探討如何在 Go 中使用流行的 github.com/pquerna/otp 庫實現 TOTP。 什麼是 TOTP?———TOTP 生成臨時密碼,這些密碼在短時間內(通常是 30 秒)有效。這項技術是 Google Authenticator、Authy 等認證器應用背後的核心技術。TOTP ⌘ Read more

⤋ Read More

Go 語言流式編程,實現高效數據處理!
在 Go 語言開發中,傳統的數據處理方式往往採用for循環配合切片操作的模式。但隨着業務複雜度提升,這種模式逐漸暴露出內存佔用高、代碼可讀性差、擴展性弱等問題。流式編程(Stream Processing)作爲一種聲明式編程範式,通過構建數據處理管道(Pipeline),爲這些問題提供了優雅的解決方案。流式編程的核心在於將數據處理過程分解爲多個獨立的操作階段,每個階段專注於單一職責。這種模式具有以 ⌘ Read more

⤋ Read More

Confusion over federal funding freeze prompts public health concerns
Alejandra O’Connell-Domenech ,  Staff Writer  -  The Hill

Stephan: The coup we are undergoing is putting millions of Americans at risk by screwing up their healthcare. There is confusion and chaos raging throughout the system, and I think we are going to very shortly see worsening health reports across the country.

![](https://www.schwartzreport.net/wp-content/uploads/2025/02/image-2.j … ⌘ Read more

⤋ Read More

10 Strange Yet True Historical Events
History is full of weird and wild things that most people go their entire lives without reading about. Stories about cat-related military operations or entire wars fought over pigs and emu. Here are 10 strange yet true historical events that are stranger than fiction. Related: 10 Bizarre Events in the Age of Reason That Defied […]

The post 10 Strange Yet True Historical Events appea … ⌘ Read more

⤋ Read More
In-reply-to » That was a super interesting talk, I can recommend it: https://media.ccc.de/v/38c3-microbes-vs-mars-a-hacker-s-guide-to-finding-alien-life

@lyse@lyse.isobeef.org Thanks for sharing. I really enjoyed it. The beginning part about the history of life on Earth was fun to watch having just read Dawkin’s old book The Selfish Geene, and now I want to read more about archaea. The end of the talk about what might be going on on Mars made me a bit hopeful someone will find some good evidence.

⤋ Read More

Trump’s trade war among allies triggers retaliation from Canada and Mexico
ROB GILLIES and FABIOLA SÁNCHEZ,  Staff Writers  -  Associated Press

Stephan: Expect prices for everything from gas to grocery store items, as well as a long list of other products, to go up significantly before the month is out. “emperor” Trump has created a trade war with our neighbors to the North and South as well as with China.

![](https://www.schwartzreport.net/wp-cont … ⌘ Read more

⤋ Read More

With tariffs signed, Trump warns of ‘pain’ to come for Americans
Kevin Liptak and Veronica Stracqualursi,  Staff Writers  -  CNN

_Stephan: Get ready for it. “emperor” Trump has just warned the Commons that as a result of the trade war he has initiated, we will all be experiencing “some pain.” This pain is going to come in all kinds of ways, not just the increase in grocery prices. There will be major loss of jobs in some states. For example as cited in this repor … ⌘ Read more

⤋ Read More

Trump signs tariffs on Canada, Mexico and China
Brett Samuels ,  Staff Writer  -  The Hill

_Stephan: Fascism like a lethal cancer is growing in the United States. Government agents are roaming the streets grabbing immigrants, families are being separated. concentration camps are being set up, federal agencies are being dismantled, the economy is about to go in to recession with tariffs, and allies are breaking away. Say goodbye to American democracy readers. It is disappearing … ⌘ Read more

⤋ Read More

CDC Purging Its Website After Trump Orders
Joyce Frieden,  Washington Editor  -  MedPage Today

_Stephan: Christofascists don’t care about the wellbeing of the country, good healthcare is not part of their agenda. That’s why the CDC websites have now been heavily censured. It is no longer going to be possible for Americans to look to the scientific agendas of the government for fact-based information on issues that are critically important to them. Nor can they rely on their governm … ⌘ Read more

⤋ Read More

Trump Executive Order Aims To Drive Federal Funds to Private School Vouchers
Erica Meltzer,  Contributing Writer  -  truthdig / Chalkbeat

_Stephan: ”king” Trump has just gutted public education in the United States. American public schools were once the envy of the world, and families came to the United States because they could get the best education possible for their children. That is no longer true, and exactly what is going to happen to pubic … ⌘ Read more

⤋ Read More

View from my window last evening:

Image

Moon, Venus, an airplane in the top left corner, wind parks in the distance.

(This is already too much for a standard camera. The moon is super bright, the rest is not. Guess I should go HDR some day?)

⤋ Read More

**Seriously?! 😳 Transscript

if I had a Go struct such as the following:

Here’s how the complete interface would look:

type B ...**
Seriously?! 😳 [Transscript](https://gist.mills.io/prologic/fe6bb412dcc245a69b4cbad22f38dcd2)

> if I had a Go struct such as the following:

…

> Here’s how the complete interface would look:

type Bar interface {

Read(t *Bar, b []byte) (int, error)

}

”`

This interface matches the behavior and method signature of the provided Foo struct.

This is total garbage 🗑️ ⌘ Read more”`

⤋ Read More

Electric cars took 89% of Norway market in 2024
,    -  Agence France-Presse (France)

Stephan: While “king” Trump and his vassals express no interest in preparation for climate change and want to “drill baby…drill.” The democracies of Europe and Asia are going in the opposite direction, and preparing to leave the carbon energy era. Here is the latest from Norway making this point.

![](https://www.schwartzreport.net/wp-content/uploads/2025/01/Screenshot-2025-01-31-at-10. … ⌘ Read more

⤋ Read More

Finally I’ll also be setting up CubeFS (finally mature enough to give it a serious go) and slowly migrating workloads to use it as Persistent …
Finally I’ll also be setting up CubeFS ( finally mature enough to give it a serious go) and slowly migrating workloads to use it as Persistent storage across the 3 Hypervisor nodes ( which will run KVM + CubeFS) – Thank goodness this thing ( CubeFS) doesn’t need to run on Kubernetes 😂 ⌘ Read more

⤋ Read More

(#ondf3bq) @lyse@lyse I have no problems with the ternary operator either. If it were added to Go I Wouldn’t mind. C has it right? I …
@lyse @lyse.isobeef.org I have no problems with the ternary operator either. If it were added to Go I Wouldn’t mind. C has it right? I’d also by happy with if expressions, e.g: if foo ... else bah, but probably doesn’t fit the styoe of the Go grammer.

What I absolutely hate is this proposal. Making ? to mag … ⌘ Read more

⤋ Read More
In-reply-to » @prologic Which one? I don't mind the ternary operator at all. In fact, I often find myself missing it in Go. I don't find the two alternatives particularly elegant:

@lyse@lyse.isobeef.org The one in question is more like the javascript version for unwrapping errors when accessing methods.

 const value = some?.deeply?.nested?.object?.value

but for handling errors returned by methods. So if you wanted to chain a bunch of function calls together and if any error return immediately. It would be something like this:

b:= SomeAPIWithErrorsInAllCalls()
b.DoThing1() ?
b.DoThing2() ?

// Though its not in the threads I assume one could do like this to chain.
b.Chain1()?.Chain2()?.End()?

I am however infavor of having a sort of ternary ? in go.

PS. @prologic@twtxt.net for some reason this is eating my response without throwing an error :( I assume it has something to do with the CSRF. Can i not have multiple tabs open with yarn?

⤋ Read More
In-reply-to » @prologic Which one? I don't mind the ternary operator at all. In fact, I often find myself missing it in Go. I don't find the two alternatives particularly elegant:

@lyse@lyse.isobeef.org The one in question is more like the javascript version for unwrapping errors when accessing methods.

 const value = some?.deeply?.nested?.object?.value

but for handling errors returned by methods. So if you wanted to chain a bunch of function calls together and if any error return immediately. It would be something like this:

b:= SomeAPIWithErrorsInAllCalls()
b.DoThing1() ?
b.DoThing2() ?

// Though its not in the threads I assume one could do like this to chain.
b.Chain1()?.Chain2()?.End()?

I am however infavor of having a sort of ternary ? in go.

PS. @prologic@twtxt.net for some reason this is eating my response without throwing an error :( I assume it has something to do with the CSRF. Can i not have multiple tabs open with yarn?

⤋ Read More
In-reply-to » My take on the discussion to introduce an ? operator in Go 👈 No. For so many reasons.

@prologic@twtxt.net Which one? I don’t mind the ternary operator at all. In fact, I often find myself missing it in Go. I don’t find the two alternatives particularly elegant:

foo := "eggs"
if bar {
    foo = "spam"
}

Or:

var foo string
if bar {
    foo = "spam"
} else {
    foo = "eggs"
}

To my eye, this just would look a lot nicer:

foo := bar ? "spam" : "eggs"

Or at least as the Pythons do it:

foo = "spam" if bar else "eggs"

The ternary operator especially shines with relatively short expressions.

⤋ Read More

**I want to propose my own counter-proposal to the discussion that’s ongoing with Go and error handling.

Here it is:

It’s very rough and needs …**
I want to propose my own counter-proposal to the discussion that’s ongoing with Go and error handling.

Here it is: https://docs.mills.io/ix4qDHMnQUSPxZ5tXz12Vg?view

It’s very rough and needs much more work, but essentially I want to propose the following change to the language’s grammar:

”`
f := os.Open(“foo.txt”) or (e error) {

lo ... ⌘ [Read more](https://twtxt.net/twt/spvh6fa)```

⤋ Read More

‘Cruel and deadly’: Aid organizations reeling from Trump’s freeze on foreign aid
Erik De La Garza,  News Writer  -  Raw Story

Stephan: The stature of the United States in the world has suffered a massive wound. I predict the Chinese are going to step into the void created by “king” Trump. We are a declining nation both within our own borders, and geopolitically.

![](https://www.schwartzreport.net/wp-content/uploads/2025/01/Screenshot-2025-01-29- … ⌘ Read more

⤋ Read More

EPA fires science advisers
Sean Reilly,    -  Politico

Stephan: ”king” Trump, by gutting the science advisory panels of the EPA,  is making it clear that the United States government during his administration is going to do nothing to prepare for the ongoing devastation of climate change. It is all part of Project 2025. As “king” Trump has said his administration is all about “drill, baby…drill.”

Image

EPA’s acting administr … ⌘ Read more

⤋ Read More

Trump Pardons Anti-Abortion Activists Who Blockaded Clinic Entrances
,    -  MedPage Today | Associated Press

Stephan: With all the other devastation being wrought by “king” Trump on the American government this hardly got mentioned, except in the medical newsletters. But “king” Trump’s purpose is clear. He and his MAGAt party are going to try to make political control of a woman’s body the national norm.

![](https://www.schwartzreport.net/wp-content/ … ⌘ Read more

⤋ Read More

i upgraded my pc from lubuntu 22.04 to 24.04 yesterday and i was like “surely there is no way this will go smoothly” but no it somehow did. like i didn’t take a backup i just said fuck it and upgraded and it WORKED?!?! i mean i had some driver issues but it wasn’t too bad to fix. wild

⤋ Read More

Federal DEI websites go dark after Trump order and threat of ‘consequences’
Robert King and Ben Leonard,    -  Politico

Stephan: In full accord with Project 2025, the American government is being restructured so that only Whites, and preferably males, are treated fairly. All DEI issues or basic civil rights are no longer protected. The United States is becoming South Africa in the 1960s.

![](https://www.schwartzreport.net/wp-content/uploads/2025/01 … ⌘ Read more

⤋ Read More

Ten Stomach-Turning Facts That We Wish Weren’t True
We’re going to go ahead and get this out there right now: You probably shouldn’t read on from here if you’ve got a queasy gut. Some of the stomach-turning facts we’re about to drop on this list are not for the faint of heart. (Or, uh, the faint of digestive tract.) But for those of […]

The post [Ten Stomach-Turning Facts That We Wish Weren’t True](https://listverse.com/2025/01/28/ten-stomach-turning-facts-that-we-wish-werent-true … ⌘ Read more

⤋ Read More
In-reply-to » I have managed to make the fetching of feeds asynchronous. To do this I have set up a small system of task queue. All requests are executed at the same time! 🚀 https://codeberg.org/andros/twtxt-el/src/branch/develop #twtxtel #emacs

@andros@twtxt.andros.dev Sweeeeet! Just gave it a try, you’ve done a wonderful work 🫡 I wanted to replay from there but couldn’t go past the first page of the feed. It kept freezing on me and complaining about some bad Url (as mentioned on the test twt), so I’ll have to dig through my follow list and see where I effed up this time. 😅

⤋ Read More

Trump executive orders threaten healthcare of millions of Americans
Marina Dunbar ,  Staff Writer  -  The Guardian (U.K.)

Stephan: Healthcare is going to deteriorate more in this country, as well as becoming more expensive As this article describes middle and lower-class Americans will be particularly affected.

Image

_Donald Trump signs an executive order in t … ⌘ Read more

⤋ Read More

Farms already seeing ‘massive drop off’ in workers as mass deportations begin: report
Erik De La Garza,  News Writer  -  Raw Story

_Stephan: Expect food prices to go up significantly in the weeks to come, as well as medical costs. I think there is a strong chance that we will be in recession by June. Also, there are going to be new international crises. I think this is going to be a very difficult period because the Republicans in the Senate … ⌘ Read more

⤋ Read More

Bloomberg to fund UN climate agency after US exit from Paris accord
,    -  Agence France-Presse (France)

Stephan: Here is what honor and integrity in support of wellbeing look like. It happens so rarely in the United States today it is unusual and notable. Note that I had to go to the French press to get the whole story.

Image

_Michael Bloomberg was the cent … ⌘ Read more

⤋ Read More

Migrating from DIY ELK to a full SaaS platform
Member post originally published on the Logz.io blog by Jade Lassery Managing modern systems requires a constant balance between operational efficiency and innovation; going a little further, maintaining seamless operations and delivering exceptional customer experiences increasingly… ⌘ Read more

⤋ Read More

A Third of the Arctic’s Landmass is Now a Source of Carbon: Study
Eloise Goldsmith,  Staff Writer  -  Common Dreams

_Stephan: Criminal Trump has made it clear that he either doesn’t care about climate change, isn’t smart enough to understand what is happening, or figures it won’t happen in his lifetime so sucking up to the petroleum oligarchs has no downside for him personally. Humanity, however, is going to experience great misery because of what Trump is doin … ⌘ Read more

⤋ Read More

golang 每日一庫之 shopspring-decimal
shopspring/decimal 是一個用於處理任意精度十進制浮點數的 Go 語言庫,通常用於金融計算、貨幣相關計算等場景。標準的 float64 類型可能無法滿足精確度要求,因爲浮點數的表示方式是近似的,特別是在進行累加、除法和精確比較時可能會導致舍入誤差。shopspring/decimal 提供了一個高精度的十進制類型 decimal.Decimal,它確保在進行數學運算時不丟失精度。這 ⌘ Read more

⤋ Read More

golang 每日一庫之 jinzhu-copier
這都 2025 年了,你還在一個一個手動複製字段嗎?jinzhu/copier 是一個 Go 語言庫,用於深度複製結構體(struct)及其字段,支持嵌套結構體、切片、數組等的複製。這個庫的主要目標是通過簡單的 API 提供高效、易用的對象複製功能,避免手動編寫複製邏輯。核心特性:深度複製支持深度複製結構體及其嵌套字段,包括切片、數組、映射(map)等。 對象的字段會遞歸地被複制到目標對象中 ⌘ Read more

⤋ Read More

10 Outrageous U.S. For-Profit Schools
Want to avoid massive loan payments for worthless degrees or certificates? In the U. S., go only to regionally accredited post-secondary schools. Avoid those that boast of being nationally accredited and those that aren’t accredited at all. Unless a school’s reputation is impeccable, such as that of an Ivy League school, it’s usually better (and […]

The post [10 Outrageous U.S. For-Profit Schools](https://listverse.com/2025/01/23/10-outrageous-u-s-for-profi … ⌘ Read more

⤋ Read More

Trump ends program to lower prescription prices, make disease therapy available
Josh Moon,  Investigative Reporter  -  Alabama Political Reporter

Stephan: We are only at day two but already you can expect your drug prices to go up. With Executive Order 14087 Trump reversed Biden’s attempt to lower the cost of drugs and treatments for cancers and other diseases. And I think this is just the beginning.

![](https://www.schwartzreport.net/wp-conte … ⌘ Read more

⤋ Read More

Go 併發控制:semaphore 詳解
今天我們來介紹一個 Go 官方庫 x 提供的擴展併發原語 semaphore,譯爲 “信號量”。因爲它就像一個信號一樣控制多個 goroutine 之間協作。概念講解我先簡單介紹下信號量的概念,爲不熟悉的讀者作爲補充知識。一個生活中的例子:假設一個餐廳總共有 10 張餐桌,每來 1 位顧客佔用 1 張餐桌,那麼同一時間共計可以有 10 人在就餐,超過 10 人則需要排隊等位;如果有 1 位顧客就餐 ⌘ Read more

⤋ Read More
In-reply-to » hmmm? 🤔

@lyse@lyse.isobeef.org @prologic@twtxt.net 😆 There was something weird going on with my #Timeline instance, the text input box was visible even though I was logged out and I was able to twt from it … It has to do with cache because it wouldn’t disappear unless I whip my website’s cache from the browser.

Poke @sorenpeter@darch.dk and @eapl.me@eapl.me I have no Idea how to reproduce this.

⤋ Read More

Netflix Increases Prices Again
Netflix is raising its prices for all plans in several countries, including the United States, Canada, Portugal, and Argentina. The cheapest Standard with ads plan will be $1 more expensive in the U.S., going from $6.99 to $7.99 per month.

Image

The Standard plan’s price will increase from $15.49 to $17.99 per month, and the Premium plan will now cost $24.99 per month, up from $22.99 per month. The St … ⌘ Read more

⤋ Read More

‘Has the world gone mad? It has’: foreign reporters share a view of Trump from abroad
Danielle Renwick,    -  The Guardian (U.K.)

_Stephan: The United States is now going down a well-traveled road, that path many other nations have recently taken as they cease to be genuine democracies and become electoral autocracies It may not be obvious to Americans and American media, but here is what it looks like to journalists from other nations that ha … ⌘ Read more

⤋ Read More
In-reply-to » I want to share a little idea for a new extension with the goal of adding direct messages in #twtxt https://github.com/tanrax/twtxt-direct-message-extension

@prologic@twtxt.net @lyse@lyse.isobeef.org First, please leave me your comments on the repository! Even if it’s just to give your opinion on what shouldn’t be included. The more variety, the better.

Second, I’m going to try to do tests with Elliptic keys and base64. Thanks for the advice @eapl@eapl.me

Finally, I’d like to give my opinion. Secure direct messages are a feature that ActivityPub and Mastodon don’t have, to give an example. By including it as an extension, we’re already taking a significant leap forward from the competition. Does it make sense to include it in a public feed? In fact, we’re already doing that. When we reply to a user, mentioning them at the beginning of the message, it’s already a direct message. The message is within a thread, perhaps breaking the conversation. Direct messages would help isolate conversations between 2 users, as well as keeping a thread cleaner and maintaining privacy. I insist, it’s optional, it doesn’t break compatibility with any client and implementing it isn’t complex. If you don’t like it, you’re free to not use it. If you don’t have a public key, no one can send you direct messages.

⤋ Read More

New memo shows ‘exactly how Republicans plan to sell out the American people’: senator
Matthew Chapman,  Staff Writer  -  Raw Story

_Stephan: I think that within the next month, starting with this coming Tuesday, we are going to see just how radically felon Trump and his MAGAts plan to restructure American society. If felon Trump does what he says he wants to do by June you and I will not recognize the United States we have known all our liv … ⌘ Read more

⤋ Read More

US to hit debt ceiling Tuesday, starting Congress’ countdown clock
Tami Luhby,  Senior Writer  -  CNN

Stephan: This isn’t what everyone is talking about today but starting tomorrow we will see this and newly inaugurated Trump’s executive orders sweep across the United States like a hurricane. Buckle up it is going to get strange and, I am afraid, very chaotic.

![](https://www.schwartzreport.net/wp-content/uploads/2025/01/Screenshot-2025-01-19-at-11.22.32 PM … ⌘ Read more

⤋ Read More

Go 表達式引擎之理解與使用 cel-go
在現代應用中,表達式求值引擎已經成爲許多系統不可或缺的一部分。它可以讓業務邏輯與代碼分離,爲動態規則配置提供極大的靈活性。而 Google 開源的 cel-go (Common Expression Language for Go) 就是這樣一款輕量級、高性能的表達式求值引擎。無論你是初學者還是需要在項目中集成 cel-go,這篇文章都將帶你從入門到精通!什麼是 CEL 和 cel-go?CEL( ⌘ Read more

⤋ Read More

Go 項目實戰 - 讓自定義 Error 支持 Go 的 errors-Is 判定以及原型模式的應用
經過前面三節高代碼強度的學習,相信大家都已經有點累了,本節我們不着急繼續 “趕路”,休息片刻!我們換個輕鬆點的話題,聊一聊咱們項目定製化 Error–AppError 怎麼支持 Go 語言的 errors.Is 判定,以及項目預定義的那些 Error 在實際使用過程中某些情況下會出現循環引用的問題,我們會利用一個原型設計模式來解決這個問題。項目定製化 Error 回顧————– ⌘ Read more

⤋ Read More

Real Estate Vultures Eye Middle-Class Enclave of Ravaged LA
Michelle Ma, Jennifer Epstein and Kelsey Butler ,  Staff Writers  -  msn | Bloomberg

_Stephan: Even as the fires still rage, the real estate profit vultures have descended on the burned-out neighborhoods of Los Angeles. We are far far from the end of this story. And, I predict, it is going to play out all over the nation as climate change wreaks havoc. To his credit, California’s Democratic Governor Gavin … ⌘ Read more

⤋ Read More

U.S. Political Parties Historically Polarized Ideologically
Megan Brenan,    -  The Gallup Organization

_Stephan: I have been telling you for years about what I call The Great Schism Trend. As this report from Gallup confirms this trend is real, and the split is growing ever greater. We are increasingly becoming two countries in a single nation. I think we will stay one nation, but I also think real power is going to move to the states, and they are going to become … ⌘ Read more

⤋ Read More

Patient Care Deteriorates After Private Equity Acquisition of Hospitals
Kristina Fiore,  Director of Enterprise & Investigative Reporting  -  MedPage Today

_Stephan: American healthcare is getting worse, as this evidence proves. Under Trump, I think the trend will continue downward because of the people he is appointing and his Congressional subservients are going to confirm. Think about it. Mehmet Oz, Robert Kennedy, Jr. both incompetent conspiracy fre … ⌘ Read more

⤋ Read More

Instagram Adds New Features to Reels as TikTok Ban Looms
With TikTok on track to be banned from U.S. app stores starting on Sunday, Instagram is adding new features to Reels, its video-based feature that’s modeled after TikTok.

Image

Going forward, there will be a new Reels feed that includes videos that your friends have liked or commented on, so you can see what your friends have watched and what they like. Your friends … ⌘ Read more

⤋ Read More

Oligarchs already own much of U.S. – can they buy democracy?
,    -  Agence France-Presse (France) / Raw Story

Stephan: Can the oligarchs buy control of the United States? They already control many of the levers of power, corporations, media, and influence in government. I think we are going to get our answer in the first 100 days of criminal Trump’s presidency.

Image

_ … ⌘ Read more

⤋ Read More

Go os-exec 極速入門
os/exec 是 Go 提供的內置包,可以用來執行外部命令或程序。比如,我們的主機上安裝了 redis-server 二進制文件,那麼就可以使用 os/exec 在 Go 程序中啓動 redis-server 提供服務。當然,我們也可以使用 os/exec 執行 ls、pwd 等操作系統內置命令。本文不求內容多麼深入,旨在帶大家極速入門 os/exec 的常規使用。極速入門如下是 os/exec ⌘ Read more

⤋ Read More

Go 語言主流安全庫使用指南
Secure Middleware - Secure—————————–secure 是一個 HTTP 中間件,提供了多種安全相關的特性。1.1 基礎使用secure 中間件提供了多個重要的安全選項,每個選項都針對特定的安全威脅:package mainimport (    ”net/http”    ”github.com/unrolled/secure ⌘ Read more

⤋ Read More

Young, single men are leaving traditional churches. They found a more ‘masculine’ alternative
Susie Coen,  U.S. Correspondent  -  The Telegraph (U.K.)

_Stephan: We have what I see as a serious negative cultural trend going on in the United States. Young single, mostly White, men don’t seem to understand what the role of manhood is about. They are frightened and resentful about gender equality. This is strongly reflected in what is happ … ⌘ Read more

⤋ Read More

Alright, I have a little 8086 assembler for my toy OS going now – or rather a proof-of-concept thereof. It only supports a tiny fraction of the instruction set. It was an interesting learning experience, but I don’t think trying to “complete” this program is worth my time.

The whole thing is just a learning project, I don’t want to actually make a usable OS. There are a few more things I want to have a look at and then I’ll eventually move on to 386/amd64 later this year (hopefully).

https://movq.de/v/d8f30cbe75/vid3.mp4

⤋ Read More

Go 併發機制解密:Goroutine 調度
Goroutine 是 Go 編程語言中一個極具特色的設計,也是其併發能力的核心亮點之一。Goroutine 本質上是一種協程(Coroutine),是實現並行計算的關鍵。使用 Goroutine 非常簡單,只需通過 go 關鍵字即可啓動一個協程,協程會以異步方式運行。程序無需等待 Goroutine 完成即可繼續執行後續代碼。go func() // 使用 go 關鍵字啓動一個協程 II. Go ⌘ Read more

⤋ Read More

淺談 Go 語言 Optional 模式和 Builder 模式
在 Go 語言中,Optional 模式和 Builder 模式都是用於對象構建和配置的重要設計模式,但它們各自具有獨特的特點和應用場景。但是使用起來也是非常的類似,就好比電動車和摩托車,都能讓你不費太多力氣的騎行,把你送到目的地,這篇文章我們就來討論一下這兩個模式的本質區別和不同的使用場景。我們首先聲明一個結構體,後面我們就研究使用兩種不同方式來創建這個結構體的實例:type Person st ⌘ Read more

⤋ Read More

** Styrofoam cups and awk **
I like writing these posts for my website, but I’ve sat down to write this one like 11 times and it either takes on a tone of totally encompassing dread and dystopian navel gazing or I feel like I’m burying my head in the sand and ignoring reality as it happens around me.

…I finished reading Victor LaValle’s The Changeling. It was engaging, and I was interested in where it was going, but I found that where it went wasn’t interesting. The dialogue and prose were lively and contemporary, which is what r … ⌘ Read more

⤋ Read More

While Los Angeles Burns, AI Fans the Flames
Schuyler Mitchell ,  Staff Writer  -  trruthout

_Stephan: I hope that you understand that the catastrophe in Los Angeles, like the one in Ashville, North Carolina, represent opening acts in what is going to be the heart-rending drama of climate change. But here, as this article describes, is an aspect of this epoch that I have not even seen mentioned before: The link between AI and the growing scarcity of water in urban areas already expe … ⌘ Read more

⤋ Read More

This could be the beginning of the end for fire insurance in California
Blanca Begert, Camille von Kaenel, Thomas Frank and Zack Colman,  Staff Writers  -  Poliitico

_Stephan: Putting aside the disinformation crap that felon Trump endlessly spews – a revealing sign as to what his administration is going to be like – what is standing out for me is the insurance issue. In large parts of Florida, it is already impossible to get home insurance, and it loo … ⌘ Read more

⤋ Read More