util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsImplements

func IsImplements(obj interface{}, ifPtr interface{}) bool

IsImplements IsImplements(&struct{}, (*struct)(nil)) check implements interface *

type Father interface {
	Father()
}
type Son1 struct {
	i int
}
func (_self *Son1) Father() {
	fmt.Println()
}
type Son2 struct {
	i int
}
func (_self *Son2) Father() {
	fmt.Println()

}

type FakeSon struct { }

func TestIsImplementInterface(t *testing.T) {
	println(IsImplements(Son1{}, (*Father)(nil))) >>false
	println(IsImplements(&Son2{}, (*Father)(nil))) >>true
	println(IsImplements(&FakeSon{}, (*Father)(nil))) >> false
}

func String

func String(value any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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