Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for AddModuleStmt (0.13 sec)

  1. src/cmd/go/internal/modcmd/edit.go

    		base.Fatal(err)
    	}
    
    	modFile, err := modfile.Parse(gomod, data, nil)
    	if err != nil {
    		base.Fatalf("go: errors parsing %s:\n%s", base.ShortPath(gomod), err)
    	}
    
    	if *editModule != "" {
    		modFile.AddModuleStmt(*editModule)
    	}
    
    	if *editGo == "none" {
    		modFile.DropGoStmt()
    	} else if *editGo != "" {
    		if err := modFile.AddGoStmt(*editGo); err != nil {
    			base.Fatalf("go: internal error: %v", err)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 13:52:10 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/mod/modfile/rule.go

    		return false
    	}
    	f := strings.Fields(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash)))
    	return (len(f) == 1 && f[0] == "indirect" || len(f) > 1 && f[0] == "indirect;")
    }
    
    func (f *File) AddModuleStmt(path string) error {
    	if f.Syntax == nil {
    		f.Syntax = new(FileSyntax)
    	}
    	if f.Module == nil {
    		f.Module = &Module{
    			Mod:    module.Version{Path: path},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 18:34:56 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  3. src/cmd/go/internal/modload/init.go

    		base.Fatalf(`go: invalid module path "%v": %v`, modPath, invalidMajorVersionMsg)
    	}
    
    	fmt.Fprintf(os.Stderr, "go: creating new go.mod: module %s\n", modPath)
    	modFile := new(modfile.File)
    	modFile.AddModuleStmt(modPath)
    	MainModules = makeMainModules([]module.Version{modFile.Module.Mod}, []string{modRoot}, []*modfile.File{modFile}, []*modFileIndex{nil}, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:36:30 UTC 2024
    - 69.8K bytes
    - Viewed (0)
Back to top