且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Golang,类型为字符串的变量

更新时间:2023-11-29 09:59:58

这是不可能的. Go不提供创建静态未知类型变量的功能.变量的类型始终是静态已知的.考虑改用接口.

This is not possible. Go does not provide functionality to create variables of types that are not known statically. The type of a variable is always known statically. Consider using interfaces instead.