Skip to content

Commit

Permalink
read.go init value with constrain
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangbits committed May 24, 2020
1 parent f4ad92d commit e6336ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c1-m4-activity/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ func main() {
text := scanner.Text()
for pos, char := range []byte(text) {
if char == ' ' {
names = append(names, Name{string(text[:pos]), string(text[pos+1:])})
tempName := Name{string(text[:pos]), string(text[pos+1:])}
names = append(names, tempName)
}
}
}
Expand Down

0 comments on commit e6336ed

Please sign in to comment.