MCPcopy Index your code
hub / github.com/coder/coder / parseObjectID

Function parseObjectID

codersdk/toolsdk/chatgpt.go:32–41  ·  view source on GitHub ↗
(id string)

Source from the content-addressed store, hash-verified

30}
31
32func parseObjectID(id string) (ObjectID, error) {
33 parts := strings.Split(id, ":")
34 if len(parts) != 2 || (parts[0] != "template" && parts[0] != "workspace") {
35 return ObjectID{}, xerrors.Errorf("invalid ID: %s", id)
36 }
37 return ObjectID{
38 Type: ObjectType(parts[0]),
39 ID: parts[1],
40 }, nil
41}
42
43func createObjectID(objectType ObjectType, id string) ObjectID {
44 return ObjectID{

Callers 1

chatgpt.goFile · 0.85

Calls 2

ObjectTypeTypeAlias · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected