Go 1.27 reference · 4 entries

Go Files, HTTP and Logging

Read and write files, scan input line by line, route and call HTTP, and write structured logs with slog.

NameDescriptionSince
os.ReadFile and os.WriteFile Read or write a whole file in one call, with Unix permissions for new files; errors wrap fs.ErrNotExist and friends.
bufio.Scanner Read input line by line (or word by word) from a file, string or stdin without loading it all into memory.
http.ServeMux and HandleFunc Route HTTP requests by method and path pattern (with {wildcards}) to handler functions using the standard library. 1.22
log/slog Write structured logs as key-value pairs in text or JSON, with levels and shared attributes. 1.21

Was this page helpful?