Skip to content

Tutorial code for my video Learn to Use Basic Data Structures - Slices, Structs and Maps in Golang

License

Notifications You must be signed in to change notification settings

isensee-bastian/text-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn to Use Basic Data Structures - Slices, Structs and Maps in Golang

  • Read text from a file and split into words.
  • Introduction to slices / lists.
  • Count total number of words (len function).
  • Read text from the terminal.
  • Get count of a specific word by searching.
  • Cleanup and normalize strings (ReplaceAll, ToLower, Peek at regexes).
  • Introduction to structs.
  • Get count for every word by using a naive search approach.
  • Sort elements in a slice / list.
  • Introduction to maps.
  • Get count for every word by using an efficient lookup approach.
  • Use time package for measuring processing duration.

Sample input text in txt files is from: https://en.wikipedia.org/wiki/Cheese

Releases

No releases published

Packages

 
 
 

Languages