在我写的打印函数中,我试图根据switch语句的结果返回一个值; 但是,我收到错误太多的参数返回.
如果这个问题有一个简单的答案,请原谅我,但不应该是一个函数有多少个参数并且它只能返回一个东西?或者它是否需要为每个参数返回一个东西.
这是我的代码.我在返回行上收到错误(要返回的参数太多).如何修复它以便返回switch语句中设置的字符串?
package bay
func Print(DATA []TD, include string, exclude []string, str string) {
result := NBC(DATA, include, exclude, str)
var sentAnal string
switch result {
case 1:
sentAnal = "Strongly Negative"
case 2:
sentAnal = "Very Negative"
case 3:
sentAnal = "Negative"
case 4:
sentAnal = "Little Negative"
case 5:
sentAnal = "Neurtral"
case 6:
sentAnal = "Little Positive"
case 7:
sentAnal = "Positive"
case 8:
sentAnal = "More Positive"
case 9:
sentAnal = "Very Positive"
case …Run Code Online (Sandbox Code Playgroud) go ×1