Lines Matching refs:err
32 var err error
33 tmpDir, err = ioutil.TempDir("", "interposer_test")
34 if err != nil {
35 panic(err)
40 err = os.Setenv("PATH", "")
41 if err != nil {
42 panic(err)
50 f, err := ioutil.TempFile(tmpDir, "interposer")
51 if err != nil {
52 t.Fatal(err)
56 err = ioutil.WriteFile(f.Name()+"_origpath", []byte(origPATH), 0666)
57 if err != nil {
58 t.Fatal(err)
89 err error
97 err: usage,
104 err: usage,
133 …err: fmt.Errorf(`exec: "path_interposer_test_does_not_exist": executable file not found in $P…
141 …err: fmt.Errorf(`"path_interposer_test_not_allowed" is not allowed to be used. See https://an…
158 exitCode, err := Main(ioutil.Discard, ioutil.Discard, interposer, testCase.args, mainOpts{
163 errstr := func(err error) string {
164 if err == nil {
167 return err.Error()
169 if errstr(testCase.err) != errstr(err) {
170 t.Errorf("unexpected error:\nwant: %v\n got: %v", testCase.err, err)
184 err := os.Remove(interposer + "_origpath")
185 if err != nil {
186 t.Fatal("Failed to remove:", err)
189 exitCode, err := Main(ioutil.Discard, ioutil.Discard, interposer, []string{"true"}, mainOpts{})
190 if err != usage {
191 t.Errorf("Unexpected error:\n got: %v\nwant: %v", err, usage)