TIL: a % 128 = 0 is the same as a & 127 = 0
'Which is a faster operation since it just requires doing the AND and not the whole division and remainder comparison' @jesusvazquezp
from https://github.com/prometheus/prometheus/pull/14118#pullrequestreview-2068077407
'Which is a faster operation since it just requires doing the AND and not the whole division and remainder comparison' @jesusvazquezp
from https://github.com/prometheus/prometheus/pull/14118#pullrequestreview-2068077407
GitHub
Check context every 128 labels instead of 100 by colega Β· Pull Request #14118 Β· prometheus/prometheus
Follow up on #14096
As promised, I bring a benchmark, which shows a very small improvement if context is checked every 128 iterations of label instead of every 100.
It's much easier for a compu...
As promised, I bring a benchmark, which shows a very small improvement if context is checked every 128 iterations of label instead of every 100.
It's much easier for a compu...
May 22, 2024
How do you track code coverage for OSS projects?
codecov seems very flaky, (will provide some details in thread)
wdyt about https://github.com/vladopajic/go-test-coverage?tab=readme-ov-file
codecov seems very flaky, (will provide some details in thread)
wdyt about https://github.com/vladopajic/go-test-coverage?tab=readme-ov-file
GitHub
GitHub - vladopajic/go-test-coverage: go-test-coverage is a tool designed to report issues when test coverage falls below a specifiedβ¦
go-test-coverage is a tool designed to report issues when test coverage falls below a specified threshold - vladopajic/go-test-coverage
June 19, 2024
August 14, 2024
For all GO haters :) https://juli1.substack.com/p/why-i-fell-in-love-with-go
Nice quote and summary:
>Technologies like JavaScript or Go are like a good burger: itβs an option that the majority understand and choose regularly. It may not be the most elegant option, but it does the job and allows us to focus on problems that matter.
Nice quote and summary:
>Technologies like JavaScript or Go are like a good burger: itβs an option that the majority understand and choose regularly. It may not be the most elegant option, but it does the job and allows us to focus on problems that matter.
Substack
Why I fell in love with Go
When I was still young in my career, I was obsessed with niche-languages mentioned in big stories on Hackernews.
August 20, 2024
What do you think if I start posting not only about Golang, but some related topics like k8s/containers?
Anonymous Poll
50%
Yes
20%
No
16%
Strong Yes
13%
i don't care
August 22, 2024
August 27, 2024
Old but still worth to read about why one shouldn;t defer Close() on writable files:
https://www.joeshaw.org/dont-defer-close-on-writable-files/
https://www.joeshaw.org/dont-defer-close-on-writable-files/
www.joeshaw.org
Don't defer Close() on writable files
It'll bite you some day
September 11, 2024
Some pitfalls about generating Kubernetes Custom Resources with `controller-gen` over the years, and how to do more rigid validation and defaulting with it:
https://ahmet.im/blog/crd-generation-pitfalls/
https://ahmet.im/blog/crd-generation-pitfalls/
Ahmet Alp Balkan
Kubernetes CRD generation pitfalls
A quick code search query reveals at least 7,000 Kubernetes Custom Resource Definitions in the open source corpus,1 most of which are likely generated with controller-gen βa tool that turns Go structs with comments-based markers into Kubernetes CRD...
September 11, 2024
September 15, 2024
Providing context to cancellations in Go 1.20 with the new context WithCause API
https://josephwoodward.co.uk/2023/01/context-cancellation-cause-with-cancel-cause
and proposal https://github.com/golang/go/issues/51365
https://josephwoodward.co.uk/2023/01/context-cancellation-cause-with-cancel-cause
and proposal https://github.com/golang/go/issues/51365
Joseph Woodward's Blog
Providing context to cancellations in Go 1.20 with the new context WithCause API
September 19, 2024
September 19, 2024
TIL: strings.Split returns [""] if s does not contain sep and sep is not empty π
Split returns a slice of length 1 whose only element is s:
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Printf("%q\n", strings.Split("", ","))
}
Split returns a slice of length 1 whose only element is s:
[""]
September 25, 2024
After releasing go1.24, we can manage tools as dependencies!
Here is very good step by step article about how to do it https://www.alexedwards.net/blog/how-to-manage-tool-dependencies-in-go-1.24-plus
Also it includes example how to add tools to seperate
Here is very good step by step article about how to do it https://www.alexedwards.net/blog/how-to-manage-tool-dependencies-in-go-1.24-plus
Also it includes example how to add tools to seperate
go.mod
file (TIL!)www.alexedwards.net
How to manage tool dependencies in Go 1.24+ - Alex Edwards
February 27
February 27
FYI: https://semgrep.dev/blog/2025/popular-github-action-tj-actionschanged-files-is-compromised/
https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised
https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised
Semgrep
π¨ Popular GitHub Action tj-actions/changed-files is compromised
Popular GitHub Action tj-actions/changed-files has been compromised with a payload that appears to attempt to dump secrets, impacting thousands of CI pipelines.
March 16
"Programming Is Like S*x: One mistake and you have to support it for the rest of your life." β Michael Sinz
πππ
πππ
March 28
Interesting approach by Russ for finding bugs by diff code coverage profiles between faing and success exectuon:
https://research.swtch.com/diffcover
https://research.swtch.com/diffcover
May 1
Classics https://status.redhat.com/
> Quay.io has been moved to read-only mode while we work to implement a fix. During this time Pulls will continue to work, however, Pushes will be disabled until a fix is implemented. There is currently no timeline for Push restoration.
> The issue has been identified. A primary key in the database has reached maximum value. We are currently working on validating a fix.
> Quay.io has been moved to read-only mode while we work to implement a fix. During this time Pulls will continue to work, however, Pushes will be disabled until a fix is implemented. There is currently no timeline for Push restoration.
> The issue has been identified. A primary key in the database has reached maximum value. We are currently working on validating a fix.
Redhat
Red Hat Status
Welcome to Red Hat's home for real-time and historical data on system performance.
May 13
Nice satire article https://www.justfuckingcode.com/ π Kinda true in many directions π
May 23
Hey k8s/containers users!
Go 1.25 not yet released but will be container aware of GOMAXPROCS https://tip.golang.org/doc/go1.25#container-aware-gomaxprocs
Go 1.25 not yet released but will be container aware of GOMAXPROCS https://tip.golang.org/doc/go1.25#container-aware-gomaxprocs
tip.golang.org
Go 1.25 Release Notes - The Go Programming Language
June 13