mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-29 18:21:10 +00:00
* feat: add ACL resource Signed-off-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com> * chore: move code under /access, cleanup acc tests Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --------- Signed-off-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com> Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
22 lines
468 B
Go
22 lines
468 B
Go
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
package ptr
|
|
|
|
// Ptr creates a ptr from a value to use it inline.
|
|
func Ptr[T any](val T) *T {
|
|
return &val
|
|
}
|
|
|
|
// Or will dereference a pointer and return the given value if it's nil.
|
|
func Or[T any](p *T, or T) T {
|
|
if p != nil {
|
|
return *p
|
|
}
|
|
|
|
return or
|
|
}
|