1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-07-27 17:28:35 +00:00

chore(tests): MockVariable helper

This commit is contained in:
Earl Warren 2025-07-03 09:19:44 +02:00
parent df2524586e
commit 9650eb8a46
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -0,0 +1,10 @@
// 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 }
}