mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
This reverts commit e5d3d3fbc3. When
adding SNMPv3, it will be odd to have this. Just put the extra mile to
deprecate it correctly.
16 lines
381 B
Go
16 lines
381 B
Go
// SPDX-FileCopyrightText: 2022 Free Mobile
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
package helpers
|
|
|
|
import "reflect"
|
|
|
|
// ElemOrIdentity returns Elem() of the provided value if this is an
|
|
// interface, else it returns the value unmodified.
|
|
func ElemOrIdentity(value reflect.Value) reflect.Value {
|
|
if value.Kind() == reflect.Interface {
|
|
return value.Elem()
|
|
}
|
|
return value
|
|
}
|