Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for ShortPath (0.13 sec)

  1. src/cmd/go/internal/workcmd/use.go

    		info, err := fsys.Stat(base.ShortPath(absArg))
    		if err != nil {
    			// Errors raised from os.Stat are formatted to be more user-friendly.
    			if os.IsNotExist(err) {
    				err = fmt.Errorf("directory %v does not exist", base.ShortPath(absArg))
    			}
    			sw.Error(err)
    			continue
    		} else if !info.IsDir() {
    			sw.Error(fmt.Errorf("%s is not a directory", base.ShortPath(absArg)))
    			continue
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 7K bytes
    - Viewed (0)
  2. src/cmd/go/internal/base/path.go

    // Cwd returns the current working directory at the time of the first call.
    func Cwd() string {
    	cwdOnce.Do(func() {
    		cwd = UncachedCwd()
    	})
    	return cwd
    }
    
    // ShortPath returns an absolute or relative name for path, whatever is shorter.
    func ShortPath(path string) string {
    	if rel, err := filepath.Rel(Cwd(), path); err == nil && len(rel) < len(path) {
    		return rel
    	}
    	return path
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 20 19:17:27 UTC 2023
    - 2K bytes
    - Viewed (0)
  3. src/cmd/go/internal/modload/vendor.go

    				} else {
    					vendErrorf(r.Old, "is replaced in %s, but not marked as replaced in vendor/modules.txt", base.ShortPath(replacementSource))
    				}
    			} else if vr != rNewCanonical {
    				vendErrorf(r.Old, "is replaced by %s in %s, but marked as replaced by %s in vendor/modules.txt", describe(rNew), base.ShortPath(replacementSource), describe(vr))
    			}
    		}
    	}
    	for _, modFile := range modFiles {
    		checkReplace(modFile.Replace)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 24 18:09:22 UTC 2023
    - 9.5K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/naming/from_stack.go

    	"regexp"
    	goruntime "runtime"
    	"runtime/debug"
    	"strconv"
    	"strings"
    )
    
    // GetNameFromCallsite walks back through the call stack until we find a caller from outside of the ignoredPackages
    // it returns back a shortpath/filename:line to aid in identification of this reflector when it starts logging
    func GetNameFromCallsite(ignoredPackages ...string) string {
    	name := "????"
    	const maxStack = 10
    	for i := 1; i < maxStack; i++ {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Nov 12 01:31:42 UTC 2019
    - 2.6K bytes
    - Viewed (0)
  5. src/cmd/go/internal/gover/toolchain.go

    		explain = "; GOTOOLCHAIN=" + Startup.GOTOOLCHAIN
    	}
    	if Startup.AutoFile != "" && (Startup.AutoGoVersion != "" || Startup.AutoToolchain != "") {
    		explain += fmt.Sprintf("; %s sets ", base.ShortPath(Startup.AutoFile))
    		if Startup.AutoToolchain != "" {
    			explain += "toolchain " + Startup.AutoToolchain
    		} else {
    			explain += "go " + Startup.AutoGoVersion
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 06 23:20:32 UTC 2023
    - 3K bytes
    - Viewed (0)
  6. src/cmd/go/internal/generate/generate.go

    			}
    			base.SetExitStatus(1)
    		}
    	}()
    	g.dir, g.file = filepath.Split(g.path)
    	g.dir = filepath.Clean(g.dir) // No final separator please.
    	if cfg.BuildV {
    		fmt.Fprintf(os.Stderr, "%s\n", base.ShortPath(g.path))
    	}
    
    	// Scan for lines that start "//go:generate".
    	// Can't use bufio.Scanner because it can't handle long lines,
    	// which are likely to appear when using generate.
    	input := bufio.NewReader(g.r)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 29 19:39:24 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  7. src/cmd/go/internal/modload/modfile.go

    // overlay, locks the file while reading, and applies fix, if applicable.
    func ReadModFile(gomod string, fix modfile.VersionFixer) (data []byte, f *modfile.File, err error) {
    	gomod = base.ShortPath(gomod) // use short path in any errors
    	if gomodActual, ok := fsys.OverlayPath(gomod); ok {
    		// Don't lock go.mod if it's part of the overlay.
    		// On Plan 9, locking requires chmod, and we don't want to modify any file
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 17:53:40 UTC 2023
    - 26.7K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modload/init.go

    		}
    		seen[modRoot] = true
    		modRoots = append(modRoots, modRoot)
    	}
    
    	for _, g := range wf.Godebug {
    		if err := CheckGodebug("godebug", g.Key, g.Value); err != nil {
    			return nil, nil, fmt.Errorf("error loading go.work:\n%s:%d: %w", base.ShortPath(path), g.Syntax.Start.Line, err)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:36:30 UTC 2024
    - 69.8K bytes
    - Viewed (0)
  9. src/cmd/go/internal/workcmd/edit.go

    	if !anyFlags {
    		base.Fatalf("go: no flags specified (see 'go help work edit').")
    	}
    
    	workFile, err := modload.ReadWorkFile(gowork)
    	if err != nil {
    		base.Fatalf("go: errors parsing %s:\n%s", base.ShortPath(gowork), err)
    	}
    
    	if *editGo == "none" {
    		workFile.DropGoStmt()
    	} else if *editGo != "" {
    		if err := workFile.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
    - 11K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modcmd/edit.go

    	}
    
    	data, err := lockedfile.Read(gomod)
    	if err != nil {
    		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 != "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 13:52:10 UTC 2024
    - 17.2K bytes
    - Viewed (0)
Back to top