mirror of
https://github.com/coder/coder.git
synced 2026-09-23 14:03:57 +08:00
18 lines
243 B
Go
18 lines
243 B
Go
package testutil
|
|
|
|
import (
|
|
"flag"
|
|
"os"
|
|
)
|
|
|
|
func InCI() bool {
|
|
_, ok := os.LookupEnv("CI")
|
|
return ok
|
|
}
|
|
|
|
func InRaceMode() bool {
|
|
fl := flag.Lookup("race")
|
|
//nolint:forcetypeassert
|
|
return fl != nil && fl.Value.(flag.Getter).Get().(bool)
|
|
}
|