In Go, there are multiple ways to make a string UpperCase, each of them are by using the strings package.

Option 1 (strings.ToUpper):

func ToUpper(str string) string

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
package main

import (
    "fmt"
    "strings"
)

func main() {
    str1 := "This is a Test"
    fmt.Println(strings.ToUpper(str1))

    // "THIS IS A TEST"
}

Option 2 (strings.ToTitle):

func ToTitle(str string) string

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
package main

import (
    "fmt"
    "strings"
)

func main() {
    str1 := "This is a Test"
    fmt.Println(strings.ToTitle(str1))

    // "THIS IS A TEST"
}