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

Function parseChatID

cli/exp_chat.go:185–194  ·  view source on GitHub ↗

parseChatID returns the chat UUID from the flag value (which serpent already populates from --chat or CODER_CHAT_ID). Returns uuid.Nil if empty (the server will auto-detect).

(flagValue string)

Source from the content-addressed store, hash-verified

183// serpent already populates from --chat or CODER_CHAT_ID). Returns
184// uuid.Nil if empty (the server will auto-detect).
185func parseChatID(flagValue string) (uuid.UUID, error) {
186 if flagValue == "" {
187 return uuid.Nil, nil
188 }
189 parsed, err := uuid.Parse(flagValue)
190 if err != nil {
191 return uuid.Nil, xerrors.Errorf("invalid chat ID %q: %w", flagValue, err)
192 }
193 return parsed, nil
194}

Callers 2

chatContextAddCommandMethod · 0.85

Calls 2

ParseMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected