Comments (2)
Yes this is normal. The intention of the restorer is to get the nodes in the correct order for AST to print them correctly. Everything else about the file will be corrupt.
What you would need to do is print the file and parse it again with AST.
from dst.
Thanks reply and your dst!
from dst.
Related Issues (20)
- panic when incorrectly formatted code HOT 2
- package's load mode uses deprecated value HOT 1
- Decorator <> AST mapping missing FuncType HOT 2
- Better control of Load? HOT 2
- Can't generate an *empty* struct HOT 3
- Will the dst package be updated when generics land? HOT 3
- Why the interface `dst.Node` remove the mth `Pos()` and `End()` from `ast.Node` ? HOT 1
- FileRestorer doesn't preserve import grouping HOT 4
- `format.Node` alternative HOT 6
- Dst doesn't support generics HOT 8
- Multi-line string literal indentation HOT 2
- Empty lines inside structs/functions are sometimes removed HOT 2
- Issue generating code using similar stdlib package path HOT 2
- dst removes line break between /* … */ comments and package statement HOT 8
- Chore: upgrade golang.org/x/tools to v0.1.12 HOT 1
- Is it support to get `go/types.Object` through `Ident` HOT 1
- Create arbitrary dst.Expr from any string? HOT 3
- Generics not working as expected when decorator uses ResolveLocalPath HOT 5
- How should I replace only one of the decs? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dst.