github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/base/goflags.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 base 6 7 import ( 8 "github.com/shogo82148/std/flag" 9 ) 10 11 // GOFLAGS returns the flags from $GOFLAGS. 12 // The list can be assumed to contain one string per flag, 13 // with each string either beginning with -name or --name. 14 func GOFLAGS() []string 15 16 // InitGOFLAGS initializes the goflags list from $GOFLAGS. 17 // If goflags is already initialized, it does nothing. 18 func InitGOFLAGS() 19 20 // SetFromGOFLAGS sets the flags in the given flag set using settings in $GOFLAGS. 21 func SetFromGOFLAGS(flags *flag.FlagSet) 22 23 // InGOFLAGS returns whether GOFLAGS contains the given flag, such as "-mod". 24 func InGOFLAGS(flag string) bool