Skip to content

go/types: update docs for modules #43293

Closed
@zombiezen

Description

@zombiezen

What did you do?

@natefinch tried to use go/types (tweet): https://play.golang.org/p/Ue77cJ9Dc3A

What did you expect to see?

A recommendation to use golang.org/x/tools/go/packages.

What did you see instead?

No such mention. The gotypes tutorial is also out-of-date and mentions golang.org/x/tools/go/loader. The golang.org/x/tools/go/loader package does contain a deprecation notice and recommends golang.org/x/tools/go/packages, which is good. I would posit that almost anybody wanting to use go/types should be using golang.org/x/tools/go/packages, so surfacing that recommendation earlier would be better.


I'm happy to send a CL for go/types package doc if there's agreement. I don't have bandwidth to take on improving the gotypes tutorial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions