Skip to content

Commit

Permalink
Split main package
Browse files Browse the repository at this point in the history
Signed-off-by: AbstractionFactory <[email protected]>
  • Loading branch information
abstractionfactory committed Jan 22, 2025
1 parent 5cc5308 commit 2942d1c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions context_1.24.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) The OpenTofu Authors
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build go1.24

package tofutestutils

import (
"context"
"github.com/opentofu/tofutestutils/testcontext"
"testing"
)

// Context creates a context with a deadline that allows for enough time to clean up a test before the testing framework
// unceremoniously kills the process. Starting with Go 1.24, this function is an alias for t.Context(). In Go 1.23 and
// lower this function reserves 25% of the test timeout, minimum 1 minute, maximum 5 minutes for cleanup.
//
// Deprecated: Consider using t.Context() instead.
func Context(t *testing.T) context.Context {
return testcontext.Context(t)
}
2 changes: 2 additions & 0 deletions context.go → context_before_1.24.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build !go1.24

package tofutestutils

import (
Expand Down

0 comments on commit 2942d1c

Please sign in to comment.