mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-07-27 17:28:35 +00:00
10 lines
214 B
Go
10 lines
214 B
Go
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package testutils
|
|
|
|
func MockVariable[T any](p *T, v T) (reset func()) {
|
|
old := *p
|
|
*p = v
|
|
return func() { *p = old }
|
|
}
|