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

Function richParametersFromMap

codersdk/toolsdk/toolsdk.go:454–463  ·  view source on GitHub ↗

richParametersFromMap converts the map shape used on tool args into the slice shape used on the wire. Iteration order is undefined, which is fine because wsbuilder treats RichParameterValues as a set keyed by Name.

(m map[string]string)

Source from the content-addressed store, hash-verified

452// slice shape used on the wire. Iteration order is undefined, which is fine
453// because wsbuilder treats RichParameterValues as a set keyed by Name.
454func richParametersFromMap(m map[string]string) []codersdk.WorkspaceBuildParameter {
455 if len(m) == 0 {
456 return nil
457 }
458 out := make([]codersdk.WorkspaceBuildParameter, 0, len(m))
459 for k, v := range m {
460 out = append(out, codersdk.WorkspaceBuildParameter{Name: k, Value: v})
461 }
462 return out
463}
464
465var CreateWorkspace = Tool[CreateWorkspaceArgs, codersdk.Workspace]{
466 Tool: aisdk.Tool{

Callers 1

toolsdk.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected