summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deno_dir_test.go4
-rw-r--r--integration_test.go21
-rw-r--r--main.go4
3 files changed, 8 insertions, 21 deletions
diff --git a/deno_dir_test.go b/deno_dir_test.go
index 51a6fb016..2c1bfb1e2 100644
--- a/deno_dir_test.go
+++ b/deno_dir_test.go
@@ -9,9 +9,7 @@ import (
func SetCacheDirForTest(prefix string) {
dir, err := ioutil.TempDir("", prefix)
- if err != nil {
- panic(err)
- }
+ check(err)
CacheDir = dir
}
diff --git a/integration_test.go b/integration_test.go
index 95452b049..2d1cbdbea 100644
--- a/integration_test.go
+++ b/integration_test.go
@@ -21,22 +21,17 @@ var denoFn string
// so if the server runs on a different port, it will fail.
func startServer() {
l, err := net.Listen("tcp", ":4545")
- if err != nil {
- panic(err)
- }
+ check(err)
rootHandler := http.FileServer(http.Dir("."))
go func() {
- if err := http.Serve(l, rootHandler); err != nil {
- panic(err)
- }
+ err := http.Serve(l, rootHandler)
+ check(err)
}()
}
func listTestFiles() []string {
files, err := ioutil.ReadDir("testdata")
- if err != nil {
- panic(err)
- }
+ check(err)
out := make([]string, 0)
for _, file := range files {
fn := file.Name()
@@ -72,9 +67,7 @@ func checkOutput(t *testing.T, outFile string, shouldSucceed bool) {
func deno(inputFn string) (actual []byte, cachedir string, err error) {
cachedir, err = ioutil.TempDir("", "TestIntegration")
- if err != nil {
- panic(err)
- }
+ check(err)
cmd := exec.Command(denoFn, "--cachedir="+cachedir, inputFn)
var out bytes.Buffer
@@ -89,9 +82,7 @@ func integrationTestSetup() {
if denoFn == "" {
startServer()
cwd, err := os.Getwd()
- if err != nil {
- panic(err)
- }
+ check(err)
denoFn = path.Join(cwd, "deno")
}
}
diff --git a/main.go b/main.go
index 6bb28fd49..465c8b5ea 100644
--- a/main.go
+++ b/main.go
@@ -76,9 +76,7 @@ func Init() {
// Use --prof for profiling JS.
if *flagGoProf != "" {
f, err := os.Create(*flagGoProf)
- if err != nil {
- panic(err)
- }
+ check(err)
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}