github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/modload/build.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 "github.com/shogo82148/std/encoding/hex" 10 11 "github.com/shogo82148/std/cmd/go/internal/modinfo" 12 ) 13 14 var ( 15 _ = hex.DecodeString("3077af0c9274080241e1c107e6d618e6") 16 _ = hex.DecodeString("f932433186182072008242104116d8f2") 17 ) 18 19 // PackageModuleInfo returns information about the module that provides 20 // a given package. If modules are not enabled or if the package is in the 21 // standard library or if the package was not successfully loaded with 22 // LoadPackages or ImportFromFiles, nil is returned. 23 func PackageModuleInfo(ctx context.Context, pkgpath string) *modinfo.ModulePublic 24 25 // PackageModRoot returns the module root directory for the module that provides 26 // a given package. If modules are not enabled or if the package is in the 27 // standard library or if the package was not successfully loaded with 28 // LoadPackages or ImportFromFiles, the empty string is returned. 29 func PackageModRoot(ctx context.Context, pkgpath string) string 30 31 func ModuleInfo(ctx context.Context, path string) *modinfo.ModulePublic 32 33 func ModInfoProg(info string, isgccgo bool) []byte 34 35 func ModInfoData(info string) []byte