Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for SetFromGOFLAGS (0.15 sec)

  1. src/cmd/go/internal/base/goflags.go

    // (It is not clear why package flag does not export this interface.)
    type boolFlag interface {
    	flag.Value
    	IsBoolFlag() bool
    }
    
    // SetFromGOFLAGS sets the flags in the given flag set using settings in $GOFLAGS.
    func SetFromGOFLAGS(flags *flag.FlagSet) {
    	InitGOFLAGS()
    
    	// This loop is similar to flag.Parse except that it ignores
    	// unknown flags found in goflags, so that setting, say, GOFLAGS=-ldflags=-w
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 19 14:42:39 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. src/cmd/go/internal/vet/vetflag.go

    				cf.String(f.Name, "", "")
    			}
    		}
    	}
    
    	// Record the set of vet tool flags set by GOFLAGS. We want to pass them to
    	// the vet tool, but only if they aren't overridden by an explicit argument.
    	base.SetFromGOFLAGS(&CmdVet.Flag)
    	addFromGOFLAGS := map[string]bool{}
    	CmdVet.Flag.Visit(func(f *flag.Flag) {
    		if isVetFlag[f.Name] {
    			addFromGOFLAGS[f.Name] = true
    		}
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 19 14:42:39 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  3. src/cmd/go/main.go

    		if os.Getenv(env.Name) != env.Value {
    			os.Setenv(env.Name, env.Value)
    		}
    	}
    
    	cmd.Flag.Usage = func() { cmd.Usage() }
    	if cmd.CustomFlags {
    		args = args[1:]
    	} else {
    		base.SetFromGOFLAGS(&cmd.Flag)
    		cmd.Flag.Parse(args[1:])
    		flagCounterPrefix := "go/" + strings.ReplaceAll(cfg.CmdName, " ", "-") + "/flag"
    		telemetry.CountFlags(flagCounterPrefix+":", cmd.Flag)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:09:11 UTC 2024
    - 10K bytes
    - Viewed (0)
  4. src/cmd/go/internal/test/testflag.go

    // to allow both
    //
    //	go test fmt -custom-flag-for-fmt-test
    //	go test -x math
    func testFlags(args []string) (packageNames, passToTest []string) {
    	base.SetFromGOFLAGS(&CmdTest.Flag)
    	addFromGOFLAGS := map[string]bool{}
    	CmdTest.Flag.Visit(func(f *flag.Flag) {
    		if short := strings.TrimPrefix(f.Name, "test."); passFlagToTest[short] {
    			addFromGOFLAGS[f.Name] = true
    		}
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 19:25:24 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  5. src/cmd/go/internal/toolchain/select.go

    		return false
    	}
    
    	if !modcacherwSeen && base.InGOFLAGS("-modcacherw") {
    		fs := flag.NewFlagSet("goInstallVersion", flag.ExitOnError)
    		fs.Var(modcacherwVal, "modcacherw", modcacherwFlag.Usage)
    		base.SetFromGOFLAGS(fs)
    	}
    
    	// It would be correct to simply return true here, bypassing use
    	// of the current go.mod or go.work, and let "go run" or "go install"
    	// do the rest, including a toolchain switch.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:25:05 UTC 2024
    - 23.4K bytes
    - Viewed (0)
Back to top