github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/modload/list.go (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package modload 6 7 import ( 8 "github.com/shogo82148/std/context" 9 10 "github.com/shogo82148/std/cmd/go/internal/modinfo" 11 ) 12 13 type ListMode int 14 15 const ( 16 ListU ListMode = 1 << iota 17 ListRetracted 18 ListDeprecated 19 ListVersions 20 ListRetractedVersions 21 ) 22 23 // ListModules returns a description of the modules matching args, if known, 24 // along with any error preventing additional matches from being identified. 25 // 26 // The returned slice can be nonempty even if the error is non-nil. 27 func ListModules(ctx context.Context, args []string, mode ListMode, reuseFile string) ([]*modinfo.ModulePublic, error)