MCPcopy Create free account
hub / github.com/coder/envbuilder / argsFromUntypedSlice

Function argsFromUntypedSlice

devcontainer/script.go:68–81  ·  view source on GitHub ↗
(args []any)

Source from the content-addressed store, hash-verified

66}
67
68func argsFromUntypedSlice(args []any) ([]string, error) {
69 if len(args) == 0 {
70 return nil, errors.New("empty command array")
71 }
72 s := make([]string, 0, len(args))
73 for _, arg := range args {
74 arg, ok := arg.(string)
75 if !ok {
76 return nil, fmt.Errorf("invalid command arg with non-string type: %v", arg)
77 }
78 s = append(s, arg)
79 }
80 return s, nil
81}
82
83func (s *LifecycleScript) Execute(ctx context.Context, uid, gid int) error {
84 procAttr := &syscall.ProcAttr{

Callers 1

UnmarshalJSONMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected