Skip to content

Commit

Permalink
Merge pull request #1704 from CarlJi/fix/gengo
Browse files Browse the repository at this point in the history
feat(gengo): support convert go+ files into go code
  • Loading branch information
xushiwei authored Feb 2, 2024
2 parents 0095021 + 92ec1b4 commit c0edde1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/internal/gengo/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ import (

// gop go
var Cmd = &base.Command{
UsageLine: "gop go [-v] [packages]",
Short: "Convert Go+ packages into Go packages",
UsageLine: "gop go [-v] [packages|files]",
Short: "Convert Go+ code into Go code",
}

var (
flag = &Cmd.Flag
flagVerbose = flag.Bool("v", false, "print verbose information")
flagCheckMode = flag.Bool("t", false, "do check syntax only, no generate gop_autogen.go")
flagSingleMode = flag.Bool("s", false, "run in single file mode")
flagSingleMode = flag.Bool("s", false, "run in single file mode for package")
flagIgnoreNotatedErr = flag.Bool(
"ignore-notated-error", false, "ignore notated errors, only available together with -t (check mode)")
)
Expand Down Expand Up @@ -88,6 +88,8 @@ func runCmd(cmd *base.Command, args []string) {
_, _, err = gop.GenGoEx(v.Dir, conf, true, flags)
case *gopprojs.PkgPathProj:
_, _, err = gop.GenGoPkgPathEx("", v.Path, conf, true, flags)
case *gopprojs.FilesProj:
_, err = gop.GenGoFiles("", v.Files, conf)
default:
log.Panicln("`gop go` doesn't support", reflect.TypeOf(v))
}
Expand Down

0 comments on commit c0edde1

Please sign in to comment.