面试题答案
一键面试package main
import "fmt"
func processValue(value interface{}) {
if num, ok := value.(int); ok {
num++
fmt.Println(num)
} else if str, ok := value.(string); ok {
str = str + "_processed"
fmt.Println(str)
} else {
fmt.Println("Unsupported type")
}
}