Change-Id: I49cda99f81b754e25fad1483de373f7d07d64808
Reviewed-on: https://go-review.googlesource.com/6452
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
import "unsafe"
-func getenv(s *byte) *byte {
- val := gogetenv(gostringnocopy(s))
- if val == "" {
- return nil
- }
- // Strings found in environment are NUL-terminated.
- return &bytes(val)[0]
-}
-
var tracebackbuf [128]byte
func gogetenv(key string) string {
import "unsafe"
-func getenv(s *byte) *byte {
- val := gogetenv(gostringnocopy(s))
- if val == "" {
- return nil
- }
- // Strings found in environment are NUL-terminated.
- return &bytes(val)[0]
-}
-
func gogetenv(key string) string {
env := environ()
if env == nil {