Complete the code to declare a string variable named greeting with the value "Hello".
var greeting [1] = "Hello"
The keyword string declares a variable of string type in Go.
Complete the code to get the length of the string variable name.
length := len([1])
The len function returns the number of characters in the string variable name.
Fix the error in the code to access the first character of the string s.
firstChar := s[[1]]Indexing strings in Go uses integer indices starting at 0 without quotes.
Fill both blanks to convert a string to a byte slice and back to a string.
bytes := []byte([1]) newStr := string([2])
Convert the original string to bytes, then convert bytes back to string.
Fill all three blanks to create a map from string to int with word lengths for words longer than 3 characters.
lengths := map[string]int{}
for _, [3] := range words {
if len([3]) > 3 {
lengths[[1]] = [2]
}
}Use word as the loop variable, map key is word, and value is len(word).
