Discover practical insights and clever solutions across languages like Go, Rust, and others. Join our community by sharing your tips and tricks—let’s grow together!

  • All (6)
  • Go (3)
  • Rust (2)
  • Postgres (1)

Using include_str!() and include_bytes!() for Compile-Time File Embedding

Learn how to embed file content at compile time in Rust using include_str!() and include_bytes!() macros.

rust

Understanding Map Growth and Memory Management

Go maps only grow; they never shrink. Learn why reinitializing or copying maps is essential when managing dynamic data.

go

Flattening Options in Rust: flatten and and_then

Learn how to work with nested Option types in Rust using flatten and and_then for cleaner, more concise code.

rust

Optimizing Large Indexes in PostgreSQL with hashtext()

Use PostgreSQL hashtext() to reduce index size for large text columns. Learn how to apply it in your index and search queries, with important considerations.

postgres

Safe Handling of Slices and Maps

Prevent unintended side effects by copying slices and maps received as arguments to maintain data integrity in Go.

go

Compile-Time Interface Compliance Checks

Enforcing interface compliance at compile time ensures your types correctly implement required interfaces, reducing runtime surprises.

go
rocket

© 2023 KungFuDev made with love / cd 💜

Heavily inspired/copied from shuttle.rs