github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/gover/gomod.go (about)

     1  // Copyright 2023 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 gover
     6  
     7  // GoModLookup takes go.mod or go.work content,
     8  // finds the first line in the file starting with the given key,
     9  // and returns the value associated with that key.
    10  //
    11  // Lookup should only be used with non-factored verbs
    12  // such as "go" and "toolchain", usually to find versions
    13  // or version-like strings.
    14  func GoModLookup(gomod []byte, key string) string