MCPcopy Index your code
hub / github.com/apache/devlake / getKeyValue

Function getKeyValue

backend/helpers/pluginhelper/api/batch_save.go:152–166  ·  view source on GitHub ↗
(iface interface{}, primaryKey []reflect.StructField)

Source from the content-addressed store, hash-verified

150}
151
152func getKeyValue(iface interface{}, primaryKey []reflect.StructField) string {
153 var ss []string
154 ifv := reflect.ValueOf(iface)
155 if ifv.Kind() == reflect.Ptr {
156 ifv = ifv.Elem()
157 }
158 for _, key := range primaryKey {
159 v := ifv.FieldByName(key.Name)
160 s := fmt.Sprintf("%v", v.Interface())
161 if s != "" {
162 ss = append(ss, s)
163 }
164 }
165 return strings.Join(ss, ":")
166}
167
168func stripZeroByte(ifc interface{}) {
169 v := reflect.ValueOf(ifc).Elem()

Callers 1

AddMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected