-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package gox | ||
|
||
import ( | ||
"go/ast" | ||
"go/token" | ||
"io" | ||
|
||
"github.com/goplus/gox/conv" | ||
"github.com/goplus/gox/dom" | ||
) | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
// Var type | ||
type Var = dom.Var | ||
|
||
// Options type | ||
type Options = dom.Options | ||
|
||
// Package type | ||
type Package = dom.Package | ||
|
||
// NewPkg func | ||
func NewPkg(name string, opts ...*Options) *Package { | ||
var theOpts *Options | ||
if opts != nil { | ||
theOpts = opts[0] | ||
} else { | ||
theOpts = &Options{} | ||
} | ||
return dom.NewPkg(name, theOpts) | ||
} | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
// From func | ||
func From(fset *token.FileSet, pkg *dom.Package) (file *ast.File, err error) { | ||
return conv.From(fset, pkg) | ||
} | ||
|
||
// WriteTo func | ||
func WriteTo(dst io.Writer, pkg *dom.Package) (err error) { | ||
return conv.WriteTo(dst, pkg) | ||
} | ||
|
||
// WriteFile func | ||
func WriteFile(file string, pkg *dom.Package) (err error) { | ||
return conv.WriteFile(file, pkg) | ||
} | ||
|
||
// ---------------------------------------------------------------------------- |