You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Solution.go
    path of file: ./repos/awesome-golang-algorithm/leetcode/1701-1800/1759.Count-Number-of-Homogenous-Substrings
    
    the code of the file until where you have to start completion: package Solution

const mod1795 = 1000000007

func S
    
func Solution(s string) int {
	ans := 0
	count := 1
	for idx := 1; idx < len(s); idx++ {
		ans = (ans + count) % mod1795
		if s[idx] == s[idx-1] {
			count++
		} else {
			count = 1
		}
	}
	ans = (ans + count) % mod1795
	return ans
}