mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
20 lines
248 B
Go
20 lines
248 B
Go
package testing
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func Getenv(t *testing.T, name string, opts ...string) string {
|
|
t.Helper()
|
|
|
|
v := os.Getenv(name)
|
|
if v == "" {
|
|
if len(opts) == 0 {
|
|
t.Fatal(name + " must be set")
|
|
}
|
|
v = opts[0]
|
|
}
|
|
return v
|
|
}
|