MCPcopy Index your code
hub / github.com/apache/answer / GetObjectTypeNumberByObjectID

Function GetObjectTypeNumberByObjectID

pkg/obj/obj.go:43–48  ·  view source on GitHub ↗

GetObjectTypeNumberByObjectID get object type by object id

(objectID string)

Source from the content-addressed store, hash-verified

41
42// GetObjectTypeNumberByObjectID get object type by object id
43func GetObjectTypeNumberByObjectID(objectID string) (objectTypeNumber int, err error) {
44 if err := checkObjectID(objectID); err != nil {
45 return 0, err
46 }
47 return converter.StringToInt(objectID[1:4]), nil
48}
49
50func checkObjectID(objectID string) (err error) {
51 if len(objectID) < 5 {

Callers 2

AddReportMethod · 0.92
AddRevisionMethod · 0.92

Calls 2

StringToIntFunction · 0.92
checkObjectIDFunction · 0.85

Tested by

no test coverage detected