Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for AddModCommonFlags (0.28 sec)

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

    func AddModFlag(flags *flag.FlagSet) {
    	flags.Var(explicitStringFlag{value: &cfg.BuildMod, explicit: &cfg.BuildModExplicit}, "mod", "")
    }
    
    // AddModCommonFlags adds the module-related flags common to build commands
    // and 'go mod' subcommands.
    func AddModCommonFlags(flags *flag.FlagSet) {
    	flags.BoolVar(&cfg.ModCacheRW, "modcacherw", false, "")
    	flags.StringVar(&cfg.ModFile, "modfile", "", "")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 06 19:23:42 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  2. src/cmd/go/internal/modcmd/init.go

    Gopkg.lock), and the current directory (if in GOPATH).
    
    See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
    `,
    	Run: runInit,
    }
    
    func init() {
    	base.AddChdirFlag(&cmdInit.Flag)
    	base.AddModCommonFlags(&cmdInit.Flag)
    }
    
    func runInit(ctx context.Context, cmd *base.Command, args []string) {
    	if len(args) > 1 {
    		base.Fatalf("go: 'go mod init' accepts at most one argument")
    	}
    	var modPath string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 19 15:51:46 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  3. src/cmd/go/internal/workcmd/init.go

    See the workspaces reference at https://go.dev/ref/mod#workspaces
    for more information.
    `,
    	Run: runInit,
    }
    
    func init() {
    	base.AddChdirFlag(&cmdInit.Flag)
    	base.AddModCommonFlags(&cmdInit.Flag)
    }
    
    func runInit(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    
    	modload.ForceUseModules = true
    
    	gowork := modload.WorkFilePath()
    	if gowork == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  4. src/cmd/go/internal/fmtcmd/fmt.go

    	"cmd/go/internal/load"
    	"cmd/go/internal/modload"
    	"cmd/internal/sys"
    )
    
    func init() {
    	base.AddBuildFlagsNX(&CmdFmt.Flag)
    	base.AddChdirFlag(&CmdFmt.Flag)
    	base.AddModFlag(&CmdFmt.Flag)
    	base.AddModCommonFlags(&CmdFmt.Flag)
    }
    
    var CmdFmt = &base.Command{
    	Run:       runFmt,
    	UsageLine: "go fmt [-n] [-x] [packages]",
    	Short:     "gofmt (reformat) package sources",
    	Long: `
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 03 12:16:35 UTC 2022
    - 3K bytes
    - Viewed (0)
  5. src/cmd/go/internal/workcmd/vendor.go

    func init() {
    	cmdVendor.Flag.BoolVar(&cfg.BuildV, "v", false, "")
    	cmdVendor.Flag.BoolVar(&vendorE, "e", false, "")
    	cmdVendor.Flag.StringVar(&vendorO, "o", "", "")
    	base.AddChdirFlag(&cmdVendor.Flag)
    	base.AddModCommonFlags(&cmdVendor.Flag)
    }
    
    func runVendor(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    	if modload.WorkFilePath() == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 24 18:09:22 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modcmd/graph.go

    	Run: runGraph,
    }
    
    var (
    	graphGo goVersionFlag
    )
    
    func init() {
    	cmdGraph.Flag.Var(&graphGo, "go", "")
    	cmdGraph.Flag.BoolVar(&cfg.BuildX, "x", false, "")
    	base.AddChdirFlag(&cmdGraph.Flag)
    	base.AddModCommonFlags(&cmdGraph.Flag)
    }
    
    func runGraph(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    
    	if len(args) > 0 {
    		base.Fatalf("go: 'go mod graph' accepts no arguments")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. src/cmd/go/internal/modcmd/verify.go

    non-zero status.
    
    See https://golang.org/ref/mod#go-mod-verify for more about 'go mod verify'.
    	`,
    	Run: runVerify,
    }
    
    func init() {
    	base.AddChdirFlag(&cmdVerify.Flag)
    	base.AddModCommonFlags(&cmdVerify.Flag)
    }
    
    func runVerify(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    
    	if len(args) != 0 {
    		// NOTE(rsc): Could take a module pattern.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 16:56:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modcmd/why.go

    var (
    	whyM      = cmdWhy.Flag.Bool("m", false, "")
    	whyVendor = cmdWhy.Flag.Bool("vendor", false, "")
    )
    
    func init() {
    	cmdWhy.Run = runWhy // break init cycle
    	base.AddChdirFlag(&cmdWhy.Flag)
    	base.AddModCommonFlags(&cmdWhy.Flag)
    }
    
    func runWhy(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    	modload.ForceUseModules = true
    	modload.RootMode = modload.NeedRoot
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 01 21:32:23 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  9. src/cmd/go/internal/workcmd/sync.go

    that in each workspace module.
    
    See the workspaces reference at https://go.dev/ref/mod#workspaces
    for more information.
    `,
    	Run: runSync,
    }
    
    func init() {
    	base.AddChdirFlag(&cmdSync.Flag)
    	base.AddModCommonFlags(&cmdSync.Flag)
    }
    
    func runSync(ctx context.Context, cmd *base.Command, args []string) {
    	modload.ForceUseModules = true
    	modload.InitWorkfile()
    	if modload.WorkFilePath() == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modcmd/tidy.go

    	cmdTidy.Flag.BoolVar(&tidyE, "e", false, "")
    	cmdTidy.Flag.BoolVar(&tidyDiff, "diff", false, "")
    	cmdTidy.Flag.Var(&tidyGo, "go", "")
    	cmdTidy.Flag.Var(&tidyCompat, "compat", "")
    	base.AddChdirFlag(&cmdTidy.Flag)
    	base.AddModCommonFlags(&cmdTidy.Flag)
    }
    
    // A goVersionFlag is a flag.Value representing a supported Go version.
    //
    // (Note that the -go argument to 'go mod edit' is *not* a goVersionFlag.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 14:56:56 UTC 2024
    - 5K bytes
    - Viewed (0)
Back to top