Posted on 9th September 2024|1113 views
Why I am getting an exception function() used as value?
I wrote a program which converts all the letters into capital letters but I am getting an exception called function() used as value here is my code
package main
import ( "fmt"
"strings" )
func capitalize(name string)
{ name = strings.ToTitle(name)
return }
func main()
{ sample := "hello"
fmt.Println(capitalize(sample)) }
Can anyone give me the exact solution?
Posted on 9th September 2024| views
package main
import ( "fmt"
"strings" )
func capitalize(name string)
string {
return strings.ToTitle(name) }
func main() {
sample := "hello"
fmt.Println(capitalize(sample)) }