mirror of
https://github.com/syumai/workers.git
synced 2025-03-11 01:39:11 +00:00
13 lines
350 B
Go
13 lines
350 B
Go
package cloudflare
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// Getenv gets a value of an environment variable.
|
|
// - https://developers.cloudflare.com/workers/platform/environment-variables/
|
|
// - This function panics when a runtime context is not found.
|
|
func Getenv(ctx context.Context, name string) string {
|
|
return getRuntimeContextEnv(ctx).Get(name).String()
|
|
}
|