This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Fellow Gophers,
I am trying to compile a short list of the best designed API's in the standard library. These API should be flexible, self documenting and provide building blocks and reusable patterns to consider when building software in Go.
Here is my short list of candidates so far. Please contribute to this list and expand or correct my rationale for my inclusions so far.
io.Writer , io.Reader
https://golang.org/pkg/io/#Writer
https://golang.org/pkg/io/#Reader
Incredibly flexible way of dealing with bytes of data. Shows the power of extremely small interfaces. An example use case would be extracting away storage of files between the local file system, a cloud storage bucket or a network server.
http.Handler and http.HandleFunc
https://golang.org/pkg/net/http/#Handler
https://golang.org/pkg/net/http/#HandleFunc
Again shows the power of small interfaces and because of the simplicity of the interface it allows powerful http middleware concepts
filepath.Walk / filepath.WalkFunc
https://golang.org/pkg/path/filepath/#Walk
A good example of how treating functions as a first class citizen can be used to simplify code. Much better than other iterator patterns found in the standard library.
Subreddit
Post Details
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/golang/comm...