github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/objabi/line.go (about) 1 // Copyright 2009 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 objabi 6 7 // WorkingDir returns the current working directory 8 // (or "/???" if the directory cannot be identified), 9 // with "/" as separator. 10 func WorkingDir() string 11 12 // AbsFile returns the absolute filename for file in the given directory, 13 // as rewritten by the rewrites argument. 14 // For unrewritten paths, AbsFile rewrites a leading $GOROOT prefix to the literal "$GOROOT". 15 // If the resulting path is the empty string, the result is "??". 16 // 17 // The rewrites argument is a ;-separated list of rewrites. 18 // Each rewrite is of the form "prefix" or "prefix=>replace", 19 // where prefix must match a leading sequence of path elements 20 // and is either removed entirely or replaced by the replacement. 21 func AbsFile(dir, file, rewrites string) string 22 23 // ApplyRewrites returns the filename for file in the given directory, 24 // as rewritten by the rewrites argument. 25 // 26 // The rewrites argument is a ;-separated list of rewrites. 27 // Each rewrite is of the form "prefix" or "prefix=>replace", 28 // where prefix must match a leading sequence of path elements 29 // and is either removed entirely or replaced by the replacement. 30 func ApplyRewrites(file, rewrites string) (string, bool)