sync old local changes

This commit is contained in:
Aliberk Sandıkçı 2023-12-31 08:48:12 +03:00
parent c879b68f06
commit 1228feddc8
Signed by: asandikci
GPG key ID: 25C67A03B5666BC1

View file

@ -11,6 +11,10 @@ type AddSymbol interface {
st() map[string]interface{} st() map[string]interface{}
} }
type myInt2 map[string]interface {
Symbol(a, b string) (interface{}, error)
}
type STR struct { type STR struct {
ress func(a string, b string) (interface{}, error) ress func(a string, b string) (interface{}, error)
} }
@ -70,13 +74,18 @@ func PluginManager(params ...string) {
panic(err) panic(err)
} }
// rst // rst
switch Symbol := symbols2["Symbol"].(type) { switch f2 := symbols2["Symbol"].(type) {
// rstrst // rstrst
case func(a, b string) (interface{}, error): case func(a, b string) (interface{}, error):
// var mystruct SymbolPlugS // var mystruct SymbolPlugS
var mystr STR var mystr STR
mystr.ress = Symbol // var inter myInt
mystr.ress = f2
// inter = mystr.ress.(myInt)
// mystr.ress = Symbol
// result, err := Im("a", "b") // result, err := Im("a", "b")
// if err != nil { // if err != nil {
@ -92,6 +101,11 @@ func PluginManager(params ...string) {
panic("Function signature was not what was expected") panic("Function signature was not what was expected")
} }
// deneme := symbols2["Symbol"]
// var inter myInt = deneme.(myInt)
// inter.Symbol("st", "st")
// Symbol := symbols2["Symbol"] // Symbol := symbols2["Symbol"]
// if f, ok := Symbol.(func(a, b string) (interface{}, error)); ok { // if f, ok := Symbol.(func(a, b string) (interface{}, error)); ok {
// // fmt.Println(HandlerType(f)("rst", "rstrtd")) // // fmt.Println(HandlerType(f)("rst", "rstrtd"))
@ -101,18 +115,35 @@ func PluginManager(params ...string) {
// for i, v := range symbols2 { // for i, v := range symbols2 {
// fmt.Println(i, v) // fmt.Println(i, v)
// } // }
fmt.Println(&symbols2) // fmt.Println(&symbols2)
fmt.Println(symbols2) // fmt.Println(symbols2)
fmt.Println() // fmt.Println()
fmt.Println(symbols) // fmt.Println(symbols)
fmt.Println(&symbols) // fmt.Println(&symbols)
defer func() {
err = module2.Unload() err = module2.Unload()
if err != nil { if err != nil {
panic(err) panic(err)
} }
}()
fmt.Println()
fmt.Println()
fmt.Println()
var empt interface{} = symbols2
var inter myInt = empt.(myInt)
// inter.Symbol("a", "b")
fmt.Println(inter)
fmt.Println(symbols2["Symbol"])
fmt.Println()
fmt.Println()
fmt.Println()
} }
func printsymbol() { type myInt interface {
// Symbol(a, b string) (interface{}, error)
} }