-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style nits #309
Comments
Thanks, I'm in general not very detail-oriented and need people to point out my laziness. Will take a look |
@peterbourgon Where is this documented? My searches seem to come up with some mixed signals golang/go#36060 |
quii
added a commit
that referenced
this issue
Jun 18, 2020
No shame here package main
import (
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
)
func main() {
path := "."
err := filepath.Walk(path, func(path string, f os.FileInfo, err error) error {
if err != nil {
return err
}
if strings.Contains(f.Name(), ".go") && !strings.Contains(path, "vendor") {
file, err := ioutil.ReadFile(path)
if err != nil {
return err
}
lines := strings.Split(string(file), "\n")
for i, line := range lines {
if strings.HasPrefix(line, `//`) {
lines[i] = lines[i] + "."
}
}
output := strings.Join(lines, "\n")
err = ioutil.WriteFile(path, []byte(output), 0644)
if err != nil {
return err
}
}
return nil
})
if err != nil {
log.Fatalf("problem opening %q, %v", path, err)
}
} |
Haha brilliant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice repo, great attention to detail. Mostly :)
The text was updated successfully, but these errors were encountered: