mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
keep it DRY <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner/--> - other - [PR](https://code.forgejo.org/forgejo/runner//pulls/759): <!--number 759 --><!--line 0 --><!--description Y2hvcmU6IGEgc2luZ2xlIHRlc3R1dGlscyBmb3IgYm90aCBhY3QgYW5kIHRoZSBydW5uZXI=-->chore: a single testutils for both act and the runner<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/759 Reviewed-by: fnetX <fnetx@noreply.code.forgejo.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
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 }
|
|
}
|