The most basic way to search for content is to use the strings package from the Go standard library. The strings package allows you to perform various operations on String objects, including searching for matches, counting occurrences, and splitting strings into arrays. The utility of this package can cover some use cases that you may run into.
Searching using the strings package
Example – Counting links
One quick and easy piece of information that we could extract using the strings package is to count the number of links that are contained in a web page. The strings package has a function called Count(), which returns the number of times a substring occurs in a string. As we have seen before, links are contained in...