mirror of
https://github.com/golang/go
synced 2024-11-18 15:04:44 -07:00
go/loader: document that package is deprecated
By now, go/packages is ready for widespread use and has obsoleted go/loader. CL 141684 and CL 155237 removed warnings from go/packages documentation. Add a deprecation notice to go/loader for visibility. Modify the deprecation notice in other packages to be consistent with the deprecation convention as documented at golang.org/wiki/Deprecated. Change-Id: Iaa93205a6e5beb3ec95f87a6d9d42f0b8ffe8e80 Reviewed-on: https://go-review.googlesource.com/c/tools/+/183418 Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
parent
663943adaa
commit
7f22187876
@ -7,7 +7,8 @@
|
||||
// of dependencies. The ASTs and the derived facts are retained for
|
||||
// later use.
|
||||
//
|
||||
// THIS INTERFACE IS EXPERIMENTAL AND IS LIKELY TO CHANGE.
|
||||
// Deprecated: This is an older API and does not have support
|
||||
// for modules. Use golang.org/x/tools/go/packages instead.
|
||||
//
|
||||
// The package defines two primary types: Config, which specifies a
|
||||
// set of initial packages to load and various other options; and
|
||||
@ -201,5 +202,3 @@ package loader
|
||||
// the error.
|
||||
//
|
||||
// The result of using concurrency is about a 2.5x speedup for stdlib_test.
|
||||
|
||||
// TODO(adonovan): overhaul the package documentation.
|
||||
|
@ -101,7 +101,7 @@ func doPackages(initial []*packages.Package, mode ssa.BuilderMode, deps bool) (*
|
||||
//
|
||||
// The mode parameter controls diagnostics and checking during SSA construction.
|
||||
//
|
||||
// Deprecated: use golang.org/x/tools/go/packages and the Packages
|
||||
// Deprecated: Use golang.org/x/tools/go/packages and the Packages
|
||||
// function instead; see ssa.ExampleLoadPackages.
|
||||
//
|
||||
func CreateProgram(lprog *loader.Program, mode ssa.BuilderMode) *ssa.Program {
|
||||
|
@ -27,7 +27,8 @@ import (
|
||||
// (as defined by "go test") defined in the specified package,
|
||||
// and its TestMain function, if any.
|
||||
//
|
||||
// Deprecated: use x/tools/go/packages to access synthetic testmain packages.
|
||||
// Deprecated: Use golang.org/x/tools/go/packages to access synthetic
|
||||
// testmain packages.
|
||||
func FindTests(pkg *Package) (tests, benchmarks, examples []*Function, main *Function) {
|
||||
prog := pkg.Prog
|
||||
|
||||
@ -112,7 +113,8 @@ func isTest(name, prefix string) bool {
|
||||
// Subsequent calls to prog.AllPackages include the new package.
|
||||
// The package pkg must belong to the program prog.
|
||||
//
|
||||
// Deprecated: use x/tools/go/packages to access synthetic testmain packages.
|
||||
// Deprecated: Use golang.org/x/tools/go/packages to access synthetic
|
||||
// testmain packages.
|
||||
func (prog *Program) CreateTestMainPackage(pkg *Package) *Package {
|
||||
if pkg.Prog != prog {
|
||||
log.Fatal("Package does not belong to Program")
|
||||
|
Loading…
Reference in New Issue
Block a user