
Go Weekly Issue #607 covers a benchmark comparing six concurrent in-memory cache designs in Go (sync.Mutex, sync.RWMutex, sharded locks, etc.), an opinion piece on avoiding excessive nil pointer checks in favor of fail-fast construction, a trick for speeding up test suites 2x by caching a migrated database, building a stateless Git server using go-git and Tigris object storage, socket activation for Go HTTP services with systemd, and the Delve 1.27 debugger release with improved Go 1.27 support.
Nguồn: https://golangweekly.com/issues/607. 8sync News chỉ tóm tắt và dẫn link; bản quyền nội dung thuộc tác giả và nguồn gốc.

Khi xây dựng hệ thống chỉ quan tâm giá trị mới nhất, cơ chế chặn mặc định của Go channels trở thành hạn chế. Bài viết giới thiệu hai cách giải quyết: gửi không chặn bằng select/default (bỏ qua giá trị khi buffer đầy, an toàn cho nhiều producers) và xả buffer trước khi gửi (đảm bảo consumer nhận dữ liệu mới nhất, nhưng yêu cầu single producer). Các ví dụ kèm biểu đồ ASCII minh họa ưu nhược điểm của từng phương pháp.
Một lập trình viên nên đọc bài này để hiểu cách xử lý hiệu quả các kênh Go khi chỉ cần lưu giữ thông tin mới nhất, tránh rủi ro về dữ liệu cũ bị giữ lại trong buffer và chọn lựa giải pháp phù hợp với từng trường hợp sử dụng cụ thể.

TypeScript 7.0 RC đã được phát hành với trình biên dịch (compiler) được viết lại bằng Go, giúp tăng tốc độ build lên gấp 10 lần so với phiên bản 6.0 nhờ sử dụng đa luồng (parallelism) và mã gốc (native code). Phiên bản mới cũng thay đổi mặc định (strict: true, module: esnext), loại bỏ các flags lỗi thời, đồng thời hỗ trợ cài đặt song song với phiên bản 6.0 qua package @typescript/typescript6.
Lập trình viên nên đọc để khám phá cách TypeScript 7.0 cải thiện hiệu suất gỡ lỗi và xây dựng dự án với tốc độ gấp 10 lần nhờ chuyển sang biên dịch viên Go, đồng thời nâng cấp tính năng mới như chế độ strict mặc định và cải tiến trong VS Code.
Một nhà phát triển hài hước kể lại hành trình khám phá các ngôn ngữ lập trình — từ LISP, COBOL, Perl, Python, Ruby, Java, JavaScript, Go đến Rust — ghi lại những đặc điểm kỳ quặc và khó chịu của từng ngôn ngữ trước khi tìm thấy sự hài lòng với Elixir và hệ sinh thái BEAM.
Làm việc với nhiều ngôn ngữ lập trình khác nhau giúp bạn hiểu rõ hơn về cách mỗi ngôn ngữ xử lý vấn đề, từ đó có thể chọn lựa và áp dụng hiệu quả hơn trong công việc thực tế.
Bài viết giới thiệu bốn hằng số tích hợp sẵn trong package slog của Go: TimeKey, LevelKey, MessageKey và SourceKey, là các khóa định nghĩa thuộc tính tự động thêm vào log bởi các handler có sẵn. Nó giải thích vai trò của từng khóa, điều kiện xuất hiện trong log (bao gồm SourceKey tùy chọn qua AddSource) và cách tương tác như viết handler tùy chỉnh hoặc dùng ReplaceAttr trong HandlerOptions.
Để hiểu cách tối ưu hóa và kiểm soát dữ liệu log trong ứng dụng Go, từ đó giảm thiểu lỗi và cải thiện khả năng debug hiệu quả.
SOCRadar has published a detailed whitepaper exposing the full attack chain behind the 'FortiBleed' campaign, a large-scale credential harvesting operation targeting over 430,000 FortiGate firewalls globally. Threat actors, likely Russian-speaking, deployed a Golang-based tool called FortigateSniffer that abuses FortiOS's built-in diagnostic commands to passively capture authentication traffic across 24 protocols without installing traditional malware. The campaign has already stolen over 110 million credentials including RADIUS, NTLM, and Kerberos material, created 659 credential-harvesting pipelines, and breached targets including a NATO-aligned defense contractor. The attack chain involves five steps: reconnaissance, credential stuffing/brute-force, passive sniffing post-compromise, hash cracking via GPU infrastructure, and lateral movement culminating in data theft or ransomware. CISA has urged organizations to harden Fortinet environments. Recommended mitigations include rotating all credentials, enforcing MFA, removing FortiGate management interfaces from internet exposure, and reviewing authentication logs.
Solod (So) v0.2 is a system-level language with Go syntax that compiles to C with zero runtime. This release adds a net package supporting TCP, UDP, and Unix domain sockets with a Go-like API, including deadlines for single-threaded servers. New compilation targets include 32-bit platforms, WebAssembly (WASI), and freestanding/bare-metal mode. C interop improvements include volatile, thread_local, and packed attribute directives, named C numeric types, Go-style type aliases, and third-party package support. The stdlib gains net/netip, encoding/hex, and a UUID package. Concurrency support is planned for v0.3.
TypeScript 7.0 RC introduces a complete compiler rewrite in Go (codenamed 'Corsa'), delivering 5-9x faster build times and ~60-70% lower memory usage. The new compiler ships as a native binary (tsgo) installable via npm. Migration steps include installing @typescript/native, deleting stale .tsbuildinfo files, running tsgo --noEmit alongside tsc to compare diagnostics, updating tsconfig.json (removing preserveConstEnums), and adjusting build pipelines. Key limitations in the RC: no programmatic Compiler API (breaking ts-morph, custom transformers), incomplete --declarationMap support, and gaps in --build mode for complex multi-project setups. Teams with large codebases (500+ files) gain the most, but the RC should not gate production releases without a parallel tsc safety net.
objgit is an experimental single-binary git server that stores repositories entirely in Tigris object storage — no local disk, no git binary, no database. Built using go-git (a pure-Go git implementation) and a billy filesystem abstraction layer already adapted for Tigris, the project maps git's on-disk format directly onto object storage. The post walks through the key engineering challenges: implementing atomic rename semantics (using Tigris's RenameObject extension), solving a stat-storm caused by go-git exploding packfiles into loose objects over SSH/git:// transports, fixing a distributed deadlock from EOF-never-arriving on persistent sockets, adding a local pack file cache to make clones feasible, and debugging a broken listing cache that was silently doing nothing due to chroot prefix mismatches. Post-receive hooks are sandboxed via a kefka sandbox. The result supports push/pull over HTTP, git://, and SSH, with repositories upserted on first push.