My GopherCon UK talk "Climbing the Testing Pyramid: From Real Service to Interface Mocks in Go" can now be watched at https://t.co/ErK7EjkEwt
Please share your thoughts and feedback.
#golang#gophercon
I have been inactive in twitter for sometime. Reason being, I was hacking yet another side project. I have leased a Hetzner cloud server and installed caddy ready to go at http://62.238.18.22/
Expecting to launch my project in a day or two!
Exciting times.
VS Code is inserting 'Co-Authored-by Copilot' into commits regardless of usage https://t.co/WEpruaPaMH. As a fan of VSCode, I also found that the last few updates were purely to push copilot.
Please suggest any other open source editor that works well for Go programming.
Go's ctx `WithoutCancel` function propagates values from the parent context and is not cancelled when the parent is cancelled. This is useful when a new goroutine wants the parent's values but should not be cancelled with the parent.
Playground https://t.co/bV1gGG50iw
#golang
Port nos below 1024 are considered privileged and need root access to listen on. It's a security nightmare to run web server as root
Solution: Run the web server on a non privileged port(eg. 8080) behind a reverse proxy like nginx that starts on port 80 and then drops privileges
#golang#tip
The port number `0` can be used to start a http server on a random available port.
This is perfect for running unit tests where multiple web servers have to be started in parallel without port conflicts.
#golang#tip
The standard library package `slog` has a `AddSource` handler option that adds the line number of the log statement to the log's output.
Try it out: https://t.co/3e8pIjqBRJ
Senior Software Developer
Company: PerceptView
Location: Boise, Idaho - USA | Remote available
Salary: $120,000 - $165,000
Tech Stack: Go, Python, Svelte
Role: Backend Go developer, creating a command and control system for CUAS
Apply here: https://t.co/FKX9X7Kz0L
#golang#job
#golang#tip A subtlety in Go that trips up newbies - Adding elements to a nil slice will work, whereas adding elements to a nil map will panic at runtime.
Try it out https://t.co/egnX6iY48r
If there is a cyclic dependency between two packages in Go, first re-evaluate whether they really need to be separate packages.
The easiest solution is often to just combine them since one cannot exist without the other. One package is simpler than two.
#golang#tip
#security#tip
Two fundamental security principles that any web application should adhere to
* Principle of least privilege - Grant only the intended permissions to users and machines
* End to end encryption - Data protection from origin to destination
Ready to climb the testing pyramid? 🧗♂️
At GopherCon UK 2025, Naveen Ramanathan gave a super practical talk 🧠 that breaks down the whole testing pyramid for services like S3. ☁️
💻 His session, "Climbing the Testing Pyramid: From Real Service to Interface Mocks in Go" covers everything from using real services and simulating failures with Toxiproxy, to running local emulators like LocalStack, and finally automating your mocks with Mockery to make life easier.
Head over to our YouTube channel to watch the replay. ▶️
@msgtonaveen@bot_golang
#golang#security#sqlinjection#tip
Always use prepared statements when querying databases using user input. Never pass user input to SQL queries using string interpolation. This will lead to SQL injection attack.