Ben Chuanlong Du's Blog

It is never too late to learn.

Check Whether a Path Exists in Golang

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips & Traps

There is no built-in function to check for the existence of a path in Golang. However, you can achieve it using os.Stat + os.IsNotExist.

Embed File in Golang Binary

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. My understanding is that embeded files are loaded into memory, which means that the Go app might consume large memory if you embed a large file.

  2. The "embed" package does not work with the Gophernotes kernel (for Jupyter/Lab notebooks).

IO in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!