Reformat tools/ files

This commit is contained in:
Eli Bendersky 2022-05-24 05:44:45 -07:00
parent 7e4533640b
commit d4bbdc258b
2 changed files with 4 additions and 4 deletions

View File

@ -37,8 +37,8 @@ func check(err error) {
}
func isDir(path string) bool {
fileStat, _ := os.Stat(path)
return fileStat.IsDir()
fileStat, _ := os.Stat(path)
return fileStat.IsDir()
}
func ensureDir(dir string) {
@ -280,7 +280,7 @@ func parseExamples() []*Example {
example.Segs = make([][]*Seg, 0)
sourcePaths := mustGlob("examples/" + exampleID + "/*")
for _, sourcePath := range sourcePaths {
if ! isDir(sourcePath) {
if !isDir(sourcePath) {
if strings.HasSuffix(sourcePath, ".hash") {
example.GoCodeHash, example.URLHash = parseHashFile(sourcePath)
} else {

View File

@ -34,7 +34,7 @@ func main() {
foundLongFile := false
for _, sourcePath := range sourcePaths {
foundLongLine := false
if ! isDir(sourcePath) {
if !isDir(sourcePath) {
lines := readLines(sourcePath)
for i, line := range lines {
// Convert tabs to spaces before measuring, so we get an accurate measure