Go IO Cookbook: code review
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- go
- Domain
- documentation
Research direction
The issue provides a Go io.Reader example and a Go Playground link, but names no repository file, test, or concrete change. Start by locating the relevant Go notes or cookbook entry and compare its guidance with the example; done is undefined until the intended documentation change is clarified.
Written by the indexing model from the issue text.
Description
Nice job. I performed a Go code review: correct, maintainable, reasonably efficient, and readable. Here are some suggestions for your directly using io.Reader code.
// Directly using io.Reader
package main
import (
"fmt"
"io"
"log"
"strings"
)
func main() {
rdr := strings.NewReader("this is the stuff I'm reading")
var data []byte
buf := make([]byte, 0, 4)
for {
n, err := rdr.Read(buf[:cap(buf)])
buf = buf[:n]
data = append(data, buf...)
if err != nil {
if err == io.EOF {
break
}
log.Fatal(err)
}
}
fmt.Println(string(data))
}
Playground: https://play.golang.org/p/k1O3Qf5K39k
- Dominant language
- No language data
- Stars
- 219
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jesseduffield/notes
-
chore: reword aboutOpen
Difficulty 1/5 Under an hour Newbie friendliness 70/100
jesseduffield/notes#3 ·
All issues in jesseduffield/notes
Similar issues
-
area:docs bug triage:confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Cotal-AI/Cotal#2875 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
FootprintAI/Containarium#2338 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
EchoTools/nevr-runtime#110 ·
Maintainers usually reply within 1 day
-
needs-human needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
gke-labs/kube-agents#2400 · 1 comment ·
Maintainers usually reply within 1 day