Skip to content

Commit

Permalink
Remove GOPATH check. Fixes #797 (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi authored and elliotchance committed Dec 30, 2018
1 parent 908e534 commit 9c3d636
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
4 changes: 0 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ func Start(args ProgramArgs) (err error) {
fmt.Println("Start tanspiling ...")
}

if os.Getenv("GOPATH") == "" {
return fmt.Errorf("The $GOPATH must be set")
}

// 1. Compile it first (checking for errors)
for _, in := range args.inputFiles {
_, err := os.Stat(in)
Expand Down
29 changes: 0 additions & 29 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,35 +340,6 @@ func TestStartPreprocess(t *testing.T) {
}
}

func TestGoPath(t *testing.T) {
gopath := "GOPATH"

existEnv := os.Getenv(gopath)
if existEnv == "" {
t.Errorf("$GOPATH is not set")
}

// return env.var.
defer func() {
err := os.Setenv(gopath, existEnv)
if err != nil {
t.Errorf("Cannot restore the value of $GOPATH")
}
}()

// reset value of env.var.
err := os.Setenv(gopath, "")
if err != nil {
t.Errorf("Cannot set value of $GOPATH")
}

// testing
err = Start(DefaultProgramArgs())
if err == nil {
t.Errorf(err.Error())
}
}

func TestMultifileTranspilation(t *testing.T) {
tcs := []struct {
source []string
Expand Down

0 comments on commit 9c3d636

Please sign in to comment.