Skip to content

Commit

Permalink
gopbuild: use new api
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Mar 9, 2024
1 parent 2ac1f5b commit ef25f03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gopbuild/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ type Package struct {

func (p *Package) ToSource() ([]byte, error) {
var buf bytes.Buffer
if err := gogen.WriteTo(&buf, p.Pkg); err != nil {
if err := p.Pkg.WriteTo(&buf); err != nil {
return nil, err
}
return buf.Bytes(), nil
}

func (p *Package) ToAst() *goast.File {
return gogen.ASTFile(p.Pkg)
return p.Pkg.ASTFile()
}

type Context struct {
Expand Down

0 comments on commit ef25f03

Please sign in to comment.