You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core_dsl.go
+2-2
Original file line number
Diff line number
Diff line change
@@ -792,8 +792,8 @@ DeferCleanup can be passed:
792
792
For example:
793
793
794
794
BeforeEach(func() {
795
-
DeferCleanup(os.SetEnv, "FOO", os.GetEnv("FOO"))
796
-
os.SetEnv("FOO", "BAR")
795
+
DeferCleanup(os.Setenv, "FOO", os.GetEnv("FOO"))
796
+
os.Setenv("FOO", "BAR")
797
797
})
798
798
799
799
will register a cleanup handler that will set the environment variable "FOO" to its current value (obtained by os.GetEnv("FOO")) after the spec runs and then sets the environment variable "FOO" to "BAR" for the current spec.
0 commit comments