Re: [go-nuts] Need advice on AST formatting

2019-10-28 Thread Marvin Renich
* roger peppe [191028 04:49]: > On Sun, 27 Oct 2019, 02:52 Marvin Renich, wrote: > > I strongly encourage you to use > > > > var fset = token.NewFileSet() > > > > rather than > > > > fset := token.NewFileSet() > > > > Those two alternatives do exactly the same thing AFAIK. How is the latter

Re: [go-nuts] Need advice on AST formatting

2019-10-28 Thread roger peppe
On Sun, 27 Oct 2019, 02:52 Marvin Renich, wrote: > * Denis Cheremisov [191026 06:09]: > > The answer was simple: > > > > var fset token.FileSet – wrong > > > > fset := token.NewFileSet() – right > > I believe I am in the minority here, but I am not a singleton minority. > There are at least seve

Re: [go-nuts] Need advice on AST formatting

2019-10-28 Thread Michel Levieux
Oh, well I'm glad it solved the problem for you Denis! Unfortunately, it seems mine's somewhere else since I was already using token.NewFileSet()... I think I might have to "re-handle" the spacing logic within my AST since I'm changing many many things and it's possible that I just break the format

Re: [go-nuts] Need advice on AST formatting

2019-10-26 Thread Marvin Renich
* Denis Cheremisov [191026 06:09]: > The answer was simple: > > var fset token.FileSet – wrong > > fset := token.NewFileSet() – right I believe I am in the minority here, but I am not a singleton minority. There are at least several of us who agree that «var» should be used over «:=» whenever

Re: [go-nuts] Need advice on AST formatting

2019-10-26 Thread Denis Cheremisov
The answer was simple: var fset token.FileSet – wrong fset := token.NewFileSet() – right вторник, 22 октября 2019 г., 11:20:38 UTC+3 пользователь Michel Levieux написал: > > Hi Denis, > > In a project of my own I encountered the same issue. This program moves a > go project to another locati

Re: [go-nuts] Need advice on AST formatting

2019-10-22 Thread Michel Levieux
Hi Denis, In a project of my own I encountered the same issue. This program moves a go project to another location, then it remembers imports (that are necessary), exported types, functions and package-scope values (var / const) and maps them in the original go project to the newly created one. Th

[go-nuts] Need advice on AST formatting

2019-10-17 Thread Denis Cheremisov
Hi! I have a utility that parses Go files into AST , makes some changes on the tree (import paths) and format it back into the Go source code, in the original file. The problem is I am using format.Node function from this package. The formatting this functio