Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for expandEnvs (4.6 sec)

  1. pkg/kubelet/kubelet_pods.go

    func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, hostDomain string, podIPs []string, podVolumes kubecontainer.VolumeMap, hu hostutil.HostUtils, subpather subpath.Interface, expandEnvs []kubecontainer.EnvVar, supportsRRO bool) ([]kubecontainer.Mount, func(), error) {
    	mountEtcHostsFile := shouldMountHostsFile(pod, podIPs)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 14 16:09:17 UTC 2024
    - 101.2K bytes
    - Viewed (0)
  2. src/os/env_unix_test.go

    		Setenv(tt.k, tt.v)
    		defer Unsetenv(tt.k)
    
    		argRaw := fmt.Sprintf("$%s", tt.k)
    		argWithBrace := fmt.Sprintf("${%s}", tt.k)
    		if gotRaw, gotBrace := ExpandEnv(argRaw), ExpandEnv(argWithBrace); gotRaw != gotBrace {
    			t.Errorf("ExpandEnv(%q) = %q, ExpandEnv(%q) = %q; expect them to be equal", argRaw, gotRaw, argWithBrace, gotBrace)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  3. src/os/env.go

    			}
    			j += w
    			i = j + 1
    		}
    	}
    	if buf == nil {
    		return s
    	}
    	return string(buf) + s[i:]
    }
    
    // ExpandEnv replaces ${var} or $var in the string according to the values
    // of the current environment variables. References to undefined
    // variables are replaced by the empty string.
    func ExpandEnv(s string) string {
    	return Expand(s, Getenv)
    }
    
    // isShellSpecialVar reports whether the character identifies a special
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:12 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  4. src/cmd/go/internal/script/state.go

    // in the form "key=value".
    func (s *State) Environ() []string {
    	return append([]string(nil), s.env...)
    }
    
    // ExpandEnv replaces ${var} or $var in the string according to the values of
    // the environment variables in s. References to undefined variables are
    // replaced by the empty string.
    func (s *State) ExpandEnv(str string, inRegexp bool) string {
    	return os.Expand(str, func(key string) string {
    		e := s.envMap[key]
    		if inRegexp {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 31 20:33:02 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  5. src/os/example_test.go

    	// Output:
    	// Good morning, Gopher!
    }
    
    func ExampleExpandEnv() {
    	os.Setenv("NAME", "gopher")
    	os.Setenv("BURROW", "/usr/gopher")
    
    	fmt.Println(os.ExpandEnv("$NAME lives in ${BURROW}."))
    
    	// Output:
    	// gopher lives in /usr/gopher.
    }
    
    func ExampleLookupEnv() {
    	show := func(key string) {
    		val, ok := os.LookupEnv(key)
    		if !ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 17:35:49 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  6. src/cmd/internal/objfile/disasm.go

    	// the leading src.FileSymPrefix.
    	filename = strings.TrimPrefix(filename, src.FileSymPrefix)
    
    	// Expand literal "$GOROOT" rewritten by obj.AbsFile()
    	filename = filepath.Clean(os.ExpandEnv(filename))
    
    	var cf *CachedFile
    	var e *list.Element
    
    	for e = fc.files.Front(); e != nil; e = e.Next() {
    		cf = e.Value.(*CachedFile)
    		if cf.FileName == filename {
    			break
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 10.5K bytes
    - Viewed (0)
  7. src/cmd/go/internal/script/cmds.go

    			return err
    		}
    		text1 = string(data)
    	}
    
    	data, err := os.ReadFile(s.Path(name2))
    	if err != nil {
    		return err
    	}
    	text2 = string(data)
    
    	if env {
    		text1 = s.ExpandEnv(text1, false)
    		text2 = s.ExpandEnv(text2, false)
    	}
    
    	if text1 != text2 {
    		if !quiet {
    			diffText := diff.Diff(name1, []byte(text1), name2, []byte(text2))
    			s.Logf("%s\n", diffText)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 28.5K bytes
    - Viewed (0)
  8. src/cmd/go/internal/script/engine.go

    			if i == j {
    				isRegexp = true
    				break
    			}
    		}
    
    		var b strings.Builder
    		for _, frag := range frags {
    			if frag.quoted {
    				b.WriteString(frag.s)
    			} else {
    				b.WriteString(s.ExpandEnv(frag.s, isRegexp))
    			}
    		}
    		args = append(args, b.String())
    	}
    	return args
    }
    
    // quoteArgs returns a string that parse would parse as args when passed to a command.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 27 01:16:19 UTC 2023
    - 22.2K bytes
    - Viewed (0)
  9. src/os/exec/exec.go

    // patterns, either call the shell directly, taking care to escape any
    // dangerous input, or use the [path/filepath] package's Glob function.
    // To expand environment variables, use package os's ExpandEnv.
    //
    // Note that the examples in this package assume a Unix system.
    // They may not run on Windows, and they do not run in the Go Playground
    // used by golang.org and godoc.org.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 41.4K bytes
    - Viewed (0)
  10. src/cmd/dist/build.go

    	b = os.Getenv("PKG_CONFIG")
    	if b == "" {
    		b = "pkg-config"
    	}
    	defaultpkgconfig = b
    
    	defaultldso = os.Getenv("GO_LDSO")
    
    	// For tools being invoked but also for os.ExpandEnv.
    	os.Setenv("GO386", go386)
    	os.Setenv("GOAMD64", goamd64)
    	os.Setenv("GOARCH", goarch)
    	os.Setenv("GOARM", goarm)
    	os.Setenv("GOARM64", goarm64)
    	os.Setenv("GOHOSTARCH", gohostarch)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:34:40 UTC 2024
    - 54K bytes
    - Viewed (0)
Back to top