Remove
Overview
Remove deletes path (fs.promises.rm).
If you are coming from Node.js, the closest pattern is fs.rm(path).
Signature
go
func Remove(ctx context.Context, path string) errorCompare: Node.js · Standard Go · gox
js
fs.rm(path)go
// os / io helpers — e.g. os.removego
import "github.com/sahilkhaire/gox/fs"
fs.Remove(ctx, path)Example
go
import "github.com/sahilkhaire/gox/fs"
fs.Remove(ctx, path)Tips
Pass context.Context as the first argument so cancellation and deadlines propagate correctly.
Standard library alternative
Use os.ReadFile, os.WriteFile, etc. Pass context.Context manually for cancellation.