主页 | Web版 | 订阅 | 归档 | Feed

GopherDaily

20250221

每日一谚:How to structure Go code? There are no hard and fast rules.


Go技术生态

如何在Go 1.24+中管理工具依赖项
Go 1.24 的一个我最喜欢的功能是管理开发工具依赖项的新功能。本文介绍了如何使用 Go 1.24 中的新功能来更有效地管理开发工具依赖项,包括添加、使用、列出、验证、管理和删除工具等。文章通过示例演示了如何使用 `go get -tool` 命令添加工具、使用 `go tool` 命令运行工具以及使用 `go mod` 命令管理工具依赖项。

从 Java 到 Go:开发人员的旅程(第一部分)
本文是作者分享从 Java 转向 Go 语言的经验之谈的第一部分。文章涵盖了学习 Go 的方法,对 Go 语言进行了简要概述,并重点比较了 Java 和 Go 在接口和函数方面的差异。作者分享了他学习 Go 的过程,包括使用在线教程和书籍,以及参与实际项目和代码审查的经验。文章还解释了 Go 的隐式接口、多返回值函数和基于值的错误处理机制,并与 Java 的显式接口、单返回值函数和基于异常的错误处理机制进行了对比。

Go 1.24 中改进的终结器:引入 runtime.AddCleanup
Go 1.24 引入了一种新的改进的终结机制,它使用 runtime.AddCleanup。此函数是对 runtime.SetFinalizer 的重大改进,它提供了更大的灵活性和更好的效率,并提高了安全性。文章探讨了 runtime.AddCleanup 如何改进终结器,为什么它优于 runtime.SetFinalizer,以及如何在实际场景中应用它。

云原生技术

Prometheus 指标详解:计数器、仪表盘、直方图和摘要
本文介绍了 Prometheus 指标的不同类型:仅增长的计数器、波动的仪表盘、显示值分布的直方图和预先计算统计数据的摘要。文章解释了指标的表示方式,包括名称、标签、值和时间戳,并详细阐述了计数器、仪表盘、直方图和摘要的用途和特点,以及如何使用它们来监控系统性能。

MySQL主键:使用方法、用途及示例
本教程将讲解MySQL主键的概念、使用方法和用途。主键用于唯一标识SQL表中的单条记录,每个记录都有一个不同的主键来唯一标识它。教程还比较了自然主键和合成主键,并介绍了自动生成合成主键的方法以及使用主键的益处,例如确保数据唯一性、加快查找速度和排序速度以及改进连接操作的性能。

当不完美的系统实际上很好:Bluesky 的有损时间线
本文探讨了在系统设计中权衡一致性、可用性、延迟和吞吐量等属性的策略。作者以 Bluesky 的时间线为例,介绍了一种名为“有损时间线”的技术,通过牺牲部分一致性来提高写入性能,从而有效解决了“热点分片”问题,并显著降低了 P99 延迟。

关于运行 systemd-nspawn 容器
本文详细介绍了一种名为systemd-nspawn的容器技术,它允许运行完整的操作系统或命令在目录树中。与chroot相比,它更加安全,因为它提供了cgroups和namespaces的安全优势。文章概述了使用systemd-nspawn启动容器的几种方法,包括使用docker export、debootstrap、mkosi、machinectl pull-tar和machinectl pull-raw,并解释了systemd-nspawn容器设置文件的作用。此外,文章还提供了更多命令,例如列出正在运行的容器、列出所有容器、列出传输、查询容器状态以及删除容器等。最后,文章还介绍了如何使用fzf来简化容器的启动过程。

软件工程职位空缺降至五年低点?
Indeed 的数据显示,与五年前相比,现在的软件开发人员职位空缺减少了 35%。与其他行业相比,软件工程师的职位空缺在 2021-2022 年增长更快,但此后下降得更快。本文探讨了造成这种情况的可能原因以及未来的走向。文章分析了多种因素,包括生成式AI的影响、利率变化、行业对工程师需求的转变以及Indeed 数据的局限性等。

AI

流行工具与项目

spf13/cobra
A Commander for modern Go CLI interactions

subtrace/subtrace
Wireshark for Docker containers

chaitin/SafeLine
SafeLine is a self-hosted WAF(Web Application Firewall) / reverse proxy to protect your web apps from attacks and exploits.

keploy/keploy
Unit and Integration Test generation for Developers. Generate tests and stubs for your application that actually work!

k8sgpt-ai/k8sgpt
Giving Kubernetes Superpowers to everyone

gitleaks/gitleaks
Find secrets with Gitleaks 🔑

danielmiessler/fabric
fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.

kubernetes/test-infra
Test infrastructure for the Kubernetes project.

trufflesecurity/trufflehog
Find, verify, and analyze leaked credentials

gruntwork-io/terragrunt
Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.

bluenviron/mediamtx
Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.

netbirdio/netbird
Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.

derailed/k9s
🐶 Kubernetes CLI To Manage Your Clusters In Style!

photoprism/photoprism
AI-Powered Photos App for the Decentralized Web 🌈💎✨

AdguardTeam/AdGuardHome
Network-wide ads & trackers blocking DNS server

jesseduffield/lazydocker
The lazier way to manage everything docker

fluxcd/flux2
Open and extensible continuous delivery solution for Kubernetes. Powered by GitOps Toolkit.

anchore/syft
CLI tool and library for generating a Software Bill of Materials from container images and filesystems

prometheus/alertmanager
Prometheus Alertmanager

nektos/act
Run your GitHub Actions locally 🚀

kubernetes-sigs/external-dns
Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services

junegunn/fzf
🌸 A command-line fuzzy finder

aws/karpenter-provider-aws
Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.

prometheus/node_exporter
Exporter for machine metrics


编辑:Tony Bai

编辑主页:tonybai.com

GopherDaily项目:github.com/bigwhite/gopherdaily

Copyright 2019-2024 GopherDaily