You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: process.go
    path of file: ./repos/chaos-mesh/pkg/ctrl/server
    
    the code of the file until where you have to start completion: // Copyright 2021 Chaos Mesh Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of 
    
func (r *Resolver) killProcess(ctx context.Context, pod *v1.Pod, pids []string) ([]*model.KillProcessResult, error) {
	pidSet := make(map[string]bool)
	for _, pid := range pids {
		pidSet[pid] = true
	}

	// all processes in target pod
	allProcess, err := r.GetPidFromPS(ctx, pod)
	if err != nil {
		return nil, errors.Wrapf(err, "get process on pod %s/%s", pod.Namespace, pod.Name)
	}

	// the intersection of all processes and pids
	var pidList []string
	var killResults []*model.KillProcessResult

	for _, process := range allProcess {
		if _, ok := pidSet[process.Pid]; ok {
			pidList = append(pidList, process.Pid)
			killResults = append(killResults, &model.KillProcessResult{
				Pid:     process.Pid,
				Command: process.Command,
			})
		}
	}
	if len(pidList) == 0 {
		return nil, nil
	}
	cmd := fmt.Sprintf("kill %s", strings.Join(pids, " "))
	if _, err = r.ExecBypass(ctx, pod, cmd, bpm.PidNS, bpm.MountNS); err != nil {
		return nil, errors.Wrapf(err, "run command %s", cmd)
	}
	return killResults, nil
}