drop the os_ prefix on the file names in os. os_test.go can stay.

R=rsc
DELTA=793  (392 added, 392 deleted, 9 changed)
OCL=24777
CL=24804
This commit is contained in:
Rob Pike 2009-02-10 16:40:06 -08:00
parent 73dd4a37f9
commit 6017895659
6 changed files with 10 additions and 10 deletions

27
src/lib/os/env.go Normal file
View file

@ -0,0 +1,27 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Environment variables.
// Setenv doesn't exist yet: don't have the run-time hooks yet
package os
import os "os"
var (
ENOENV = NewError("no such environment variable");
)
func Getenv(s string) (v string, err *Error) {
n := len(s);
if n == 0 {
return "", EINVAL
}
for i, e := range sys.Envs {
if len(e) > n && e[n] == '=' && e[0:n] == s {
return e[n+1:len(e)], nil
}
}
return "", ENOENV
}