Git Product home page Git Product logo

Comments (2)

roberthorn avatar roberthorn commented on May 27, 2024

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"
)

@joverbey

from godoctor.

joverbey avatar joverbey commented on May 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.