37 Star 403 Fork 75

GVPrancher/rancher

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
validate.go 366 Bytes
Copy Edit Raw Blame History
Darren Shepherd authored 2018-07-13 13:41 . Refactor IsEmpty
package configfield
import (
"strings"
"github.com/rancher/norman/types/convert"
)
func GetDriver(obj interface{}) string {
data, _ := convert.EncodeToMap(obj)
driver := ""
for k, v := range data {
if !strings.HasSuffix(k, "Config") || convert.IsAPIObjectEmpty(v) {
continue
}
driver = strings.TrimSuffix(k, "Config")
break
}
return driver
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.13

Search