Comments (2)
The original issue is actually how we're checking for the godoc comment. Currently checking the ast.TypeSpec
doc field for an existing comment, which is only present with declaration groups. Have to use the doc field in ast.GenDecl
in the case of a non-group declaration.
This also means we weren't properly checking for godoc comments for value declarations (constants and vars).
Question is: for group declarations, do we want to comment on the declaration or each specified name? It's valid to have a single godoc comment for the entire group or for each exported declaration.
Example, given this:
const (
A = "foo"
B = "bar"
)
Do we want this:
// TODO: NEED COMMENT INFO
const (
A = "foo"
B = "bar"
)
Or this:
const (
// A TODO: NEED COMMENT INFO
A = "foo"
// B TODO: NEED COMMENT INFO
B = "bar"
)
from godoctor.
@roberthorn Whatever you think; your call. Which one do people want most of the time? Worst case, we could add a boolean flag to the refactoring to toggle the behavior, but I'd prefer to just do something reasonable by default.
I was trying to use, as an example, https://golang.org/pkg/go/token/#Token - source at https://golang.org/src/go/token/token.go#L13 - but I probably need to look at some more godoc to form an opinion
from godoctor.
Related Issues (20)
- go get godoctor fails with Go v1.5 HOT 1
- godoctor rename issue HOT 4
- Move away from version numbers? HOT 3
- OpenRefactory JSON protocol documentation is missing HOT 3
- Can't rename struct fields HOT 3
- Go Doctor interactive mode? HOT 2
- Add scope detection based on VCS root HOT 6
- Function Extract failure HOT 7
- Extract Function failure - variable's previous value ignored HOT 2
- Named returns should be live at exit HOT 3
- Cut releases more frequently
- Is this tool actively mantained ? HOT 1
- Does it work with go modules? HOT 7
- Site down http://gorefactor.org/
- it seems like go module cannot work with "Extract to function" in vscode HOT 2
- godoctor causing dockerfile build failure HOT 4
- help!i can not complie master
- Manual not visible HOT 1
- Tests are broken HOT 7
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 godoctor.