summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/extern.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-16 23:10:33 -0700
committerRuss Cox <rsc@golang.org>2010-03-16 23:10:33 -0700
commit504ccfeeda3134aa47e4a9646c8885782f513539 (patch)
tree54618cda4018c5a0abe309fb4d7bf02d9c71551c /src/pkg/runtime/extern.go
parent95426769e7a75e8d10e0a37022c694a7283f4649 (diff)
downloadgolang-504ccfeeda3134aa47e4a9646c8885782f513539.tar.gz
runtime: add GOROOT and Version
R=r CC=golang-dev http://codereview.appspot.com/608041
Diffstat (limited to 'src/pkg/runtime/extern.go')
-rw-r--r--src/pkg/runtime/extern.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go
index f34bb2256..b4d903c30 100644
--- a/src/pkg/runtime/extern.go
+++ b/src/pkg/runtime/extern.go
@@ -150,3 +150,23 @@ func GC()
// TODO(rsc): allow f to have (ignored) return values
//
func SetFinalizer(x, f interface{})
+
+func getgoroot() string
+
+// GOROOT returns the root of the Go tree.
+// It uses the GOROOT environment variable, if set,
+// or else the root used during the Go build.
+func GOROOT() string {
+ s := getgoroot()
+ if s != "" {
+ return s
+ }
+ return defaultGoroot
+}
+
+// Version returns the Go tree's version string.
+// It is either a sequence number or, when possible,
+// a release tag like "release.2010-03-04".
+// A trailing + indicates that the tree had local modifications
+// at the time of the build.
+func Version() string { return defaultVersion }