Re: [go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread Todd Neal
n...@mit.edu writes: > Thanks Todd. That fixed my problem. > > Concerning the dummy nodes to want to add to an AST, you could try adding > dummy methods to make them to conform to ast.Stmt or whatever? > You can, and you can add them as Expr's or Decl's but then you lose the ability to use ast.

Re: [go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread naha
Thanks Todd. That fixed my problem. Concerning the dummy nodes to want to add to an AST, you could try adding dummy methods to make them to conform to ast.Stmt or whatever? On Tuesday, August 28, 2018 at 6:33:12 PM UTC-4, Todd Neal wrote: > > > > na...@mit.edu writes: > > > As can be seen fr

Re: [go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread Todd Neal
n...@mit.edu writes: > As can be seen from my recent posts, I've been playing a lot with the > automatic generation if go programs using go/ast and related packages. > > My current problem is that when I use astutil.AddImport. > > When I rn the program below, which creates a new ast.File and u

[go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread naha
As can be seen from my recent posts, I've been playing a lot with the automatic generation if go programs using go/ast and related packages. My current problem is that when I use astutil.AddImport. When I rn the program below, which creates a new ast.File and uses astutil.AddImport to import to