在Go语言中,函数结尾缺少返回

package main
import (
       "fmt"
)


func iLoveGoLang(sign string) (int , int) {
  if sign == "!" {
    return (14 - 2),( 3 + 3 - 6);
} else if sign == "@" {
    return (41 - (20 * 2)),(5 - 4)
}  else if sign == "$" {
    return 1,3
} else if sign == "^" {
    return 2,2
}  else if sign == "5" {
    return 3, 2
} else if sign == "(" {
    return (4 * 2) - 1, 1 
} else if sign == ")" {
    return (2*2), 2
} else if sign == "d" {
    return 2, 5
} else if sign == ">" {
    return (3 * 3) + 2, 1
} else if sign == "~" {
    return (2 * 2), (3 * 1)
} else if sign == "#" {
    return 2,1
} else if sign == "+" {
    return 13,1
} else if sign == "&" {
    return (2+3),1
} else if sign == "/" {
    return (3 + 4), 2
} else if sign == ";" {
    return (33 / 11), 3
} else if sign == "e" {
    return (2 + 3), (8 - 5)
}


    return -1,1
}

 func getLetter(value int) string {



 } 


  func main() {
  var inputString = "^(>));@&^$^d5(5>/()!ed(e5>/&e&!^"

  var gdg, srilanka = iLoveGoLang("@")
  var letter = getLetter(gdg * srilanka)

//you need to do that for all letters.

 }

I am unable to get an output. Though I added a return type to the getLetter function it does not work. It also keeps saying imported and not used: "fmt".

If you define a function with a return value you also need to return something:

func getLetter(value int) string {
    return ""
} 

This will fix your first error.

For the second error just remove the import ( "fmt" ) part. Go does not allow you to import a package and then not use it.

EDIT: as is being suggested: run go imports on the file will automatically add/remove imports. There are editors out there that do this automatically on every save for you. I prefer Goland but also VSCode has a great Go-Plugin. There are other great editors that support Go of course.

Same with variables: inputString and letter are declared but not used. If you are still in programming phase but want to run it already you can either print the variables:

fmt.Println(inputString, letter)

or assign them to the empty receiver:

_ = inputString

Then the compiler considers them used.

Here your code in a runnable fashion: playground