reflectkit

package
v0.158.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseTypeOf

func BaseTypeOf(i interface{}) reflect.Type

func BaseValue

func BaseValue(v reflect.Value) reflect.Value

func BaseValueOf

func BaseValueOf(i interface{}) reflect.Value

func Cast

func Cast[T any](v any) (T, bool)

func FullyQualifiedName

func FullyQualifiedName(e interface{}) string
Example
package main

import (
	"fmt"
	"github.com/adamluzsi/frameless/pkg/reflectkit"
)

func main() {
	fmt.Println(reflectkit.FullyQualifiedName(Example{}))
}

type Example struct {
	Name string
}
Output:

func IsValueEmpty

func IsValueEmpty(val reflect.Value) bool

func IsValueNil

func IsValueNil(val reflect.Value) bool
func Link(src, ptr interface{}) (err error)

Link will make destination interface be linked with the src value.

func SetValue added in v0.154.0

func SetValue(variable, value reflect.Value)

SetValue will force set

func SymbolicName

func SymbolicName(e interface{}) string
Example
package main

import (
	"fmt"
	"github.com/adamluzsi/frameless/pkg/reflectkit"
)

func main() {
	fmt.Println(reflectkit.SymbolicName(Example{}))
}

type Example struct {
	Name string
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL