github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/modfetch/coderepo.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 modfetch 6 7 // LegacyGoMod generates a fake go.mod file for a module that doesn't have one. 8 // The go.mod file contains a module directive and nothing else: no go version, 9 // no requirements. 10 // 11 // We used to try to build a go.mod reflecting pre-existing 12 // package management metadata files, but the conversion 13 // was inherently imperfect (because those files don't have 14 // exactly the same semantics as go.mod) and, when done 15 // for dependencies in the middle of a build, impossible to 16 // correct. So we stopped. 17 func LegacyGoMod(modPath string) []byte