New filters on the Home Feed, take a look!
view details

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.

14
Best Designed Standard Library API's
Post Body

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.

Author
User Disabled
Account Strength
0%
Disabled 5 months ago
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
2,982
Link Karma
2,169
Comment Karma
813
Profile updated: 3 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago