telemetry: add Dir function for use by go telemetry

Add a function to get the telemetry directory. It will be used by go clean -telemetry and go env GOTELEMETRYDIR.

Change-Id: I0e2e523929f3e164ea0b6ae584f772c1b1f15c08
Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/584304
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/dir.go b/dir.go
new file mode 100644
index 0000000..5931669
--- /dev/null
+++ b/dir.go
@@ -0,0 +1,12 @@
+// Copyright 2024 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.
+
+package telemetry
+
+import "golang.org/x/telemetry/internal/telemetry"
+
+// Dir returns the telemetry directory.
+func Dir() string {
+	return telemetry.Default.Dir()
+}