You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
This is a bug in the Go Tour on the website, so latest version I assume.
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
Windows
What did you do?
This word count code is "incorrect" according to the test suite which expects a value of 1 for all words.
func WordCount(s string) map[string]int {
words := strings.Fields(s);
fmt.Printf("%T, %d\n", words, len(words))
fmt.Println(words)
var result = make(map[string]int)
for _, v := range words {
result[v] = len(v)
}
return result
}
What did you expect to see?
A test pass
What did you see instead?
A test fail
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?This is a bug in the Go Tour on the website, so latest version I assume.
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?Windows
What did you do?
This word count code is "incorrect" according to the test suite which expects a value of 1 for all words.
func WordCount(s string) map[string]int {
words := strings.Fields(s);
}
What did you expect to see?
A test pass
What did you see instead?
A test fail
The text was updated successfully, but these errors were encountered: