mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
11 lines
127 B
Go
11 lines
127 B
Go
|
package piperutils
|
||
|
|
||
|
func SafeDereference[T any](p *T) T {
|
||
|
if p == nil {
|
||
|
var zeroValue T
|
||
|
return zeroValue
|
||
|
}
|
||
|
|
||
|
return *p
|
||
|
}
|