net.go 207 B

1234567891011
  1. package testutils
  2. import (
  3. "os"
  4. )
  5. // IsRunningInContainer returns whether the test is running inside a container.
  6. func IsRunningInContainer() bool {
  7. _, err := os.Stat("/.dockerenv")
  8. return err == nil
  9. }