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 formatting by copying things around. I'll tell you guys if ever I find something that fixes my case.
@Marvin, I'd say I don't agree with you. Your point is interesting, but in my opinion using one construct over another is mainly subjective. If the "var" construct is safer in terms of hard-to-find bugs, the ":=" construct tends to improve readability a lot, especially when there are lots and lots of variables involved. Moreover, when juggling with constructs such as "something, err := func()", it is really convenient to not have to think too much about whether "err" wad already declared higher in the block. Again, I'm not arguing because I can understand that people might prefer the way around, just stating an opinion here :) Le dim. 27 oct. 2019 à 03:52, Marvin Renich <m...@renich.org> a écrit : > * Denis Cheremisov <denis.cheremi...@gmail.com> [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 possible, and when you do use «:=», you should be > very careful, because it is frequently the cause of hidden shadowing > bugs. This is especially true when declaring multiple variables. > > I strongly encourage you to use > > var fset = token.NewFileSet() > > rather than > > fset := token.NewFileSet() > > ...Marvin > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/20191027025214.uqkd4rtu6gbrbt5b%40basil.wdw > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CANgi335Tm%3DChOMAQ9gjr3xgeYwf6_PWD2Fo2jCa0tMKV1MhXZw%40mail.gmail.com.