diff --git a/gorazor/cases/import.gohtml b/gorazor/cases/import.gohtml index 244fab9..be3bec2 100644 --- a/gorazor/cases/import.gohtml +++ b/gorazor/cases/import.gohtml @@ -1,6 +1,11 @@ @{ -import "strconv" -import "now" +import ("strconv") +import ("now") +import "this" +import ( + "hello" + "huhu" + ) ) } diff --git a/gorazor/gogen.go b/gorazor/gogen.go index 2d5d8d7..8feac00 100644 --- a/gorazor/gogen.go +++ b/gorazor/gogen.go @@ -132,7 +132,8 @@ func (cp *Compiler) visitFirstBLK(blk *Ast) { fset := token.NewFileSet() f, err := parser.ParseFile(fset, "", "package main\n"+first, parser.ImportsOnly) if err != nil { - panic(err) + fmt.Println(err) + os.Exit(1) } else { for _, s := range f.Imports { v := s.Path.Value diff --git a/gorazor/test/import.go b/gorazor/test/import.go index e651bd6..7faec1c 100644 --- a/gorazor/test/import.go +++ b/gorazor/test/import.go @@ -2,8 +2,11 @@ package cases import ( "bytes" + "hello" + "huhu" "now" "strconv" + "this" ) func Import() string {