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

Function procEnv

agent/agentexec/cli_linux_test.go:208–214  ·  view source on GitHub ↗

procEnv returns the environment variables for a given process.

(t *testing.T, pid int)

Source from the content-addressed store, hash-verified

206
207// procEnv returns the environment variables for a given process.
208func procEnv(t *testing.T, pid int) []string {
209 t.Helper()
210
211 env, err := os.ReadFile(fmt.Sprintf("/proc/%d/environ", pid))
212 require.NoError(t, err)
213 return strings.Split(string(env), "\x00")
214}
215
216func expectedNiceScore(t *testing.T) int {
217 t.Helper()

Callers 1

TestCLIFunction · 0.85

Calls 2

HelperMethod · 0.65
ReadFileMethod · 0.65

Tested by

no test coverage detected