Fix compile output name (#58)

* Fix output file name

* Bump version
This commit is contained in:
Pedro Miguel Domingos da Costa 2018-03-29 07:24:45 +01:00 committed by Anthony De Meulemeester
parent 34bd9d31ac
commit c51a6d3e57
2 changed files with 2 additions and 1 deletions

View file

@ -1 +1 @@
0.35.0
0.35.1

View file

@ -75,6 +75,7 @@ func CompileAndSave(src string, o *Options) error {
if !strings.HasSuffix(src, ".go") {
return fmt.Errorf("%s is not a Go file", src)
}
o.Outfile = strings.TrimSuffix(o.Outfile, fmt.Sprintf(".%s", fileExt))
if len(o.Outfile) == 0 {
o.Outfile = strings.TrimSuffix(src, ".go")
}