1 changed files with 85 additions and 0 deletions
@ -0,0 +1,85 @@ |
|||
package nhooyrioWebsocketAddons |
|||
|
|||
//Funktionierender Mustercode
|
|||
|
|||
/* //Alt: Ohne Pointer
|
|||
|
|||
package main |
|||
|
|||
import ( |
|||
"encoding/json" |
|||
"fmt" |
|||
"zmpTmp/nh" |
|||
) |
|||
|
|||
var buffer nh.GosmAdapter |
|||
var container nh.GosmAdapter |
|||
|
|||
func main() { |
|||
container = &nh.GosmContainer{nh.GosmContainerSection{"A", "BB", "CCC", true, "DDDD"}, nh.GosmContainerSection{"D", "EE", "FFF", false, "GGGG"}} |
|||
buffer, _ = container.Convert() |
|||
|
|||
fmt.Printf("%T\n", buffer) |
|||
|
|||
//buffer.Revalue()
|
|||
|
|||
fmt.Println(buffer) |
|||
|
|||
newContainer, _ := buffer.Convert() |
|||
//newContainer.Revalue()
|
|||
fmt.Printf("%T\n", newContainer) |
|||
fmt.Println(newContainer) |
|||
|
|||
j, err := json.Marshal(container) |
|||
if err != nil { |
|||
panic(err) |
|||
} |
|||
fmt.Println(j) |
|||
} |
|||
*/ |
|||
|
|||
/* //Neu: Mit Pointer
|
|||
|
|||
package main |
|||
|
|||
import ( |
|||
"encoding/json" |
|||
"fmt" |
|||
|
|||
//"zmpTmp/nh"
|
|||
nh "git.archium.org/archium_public/ebkTools/nhooyrioWebsocketAddons" |
|||
) |
|||
|
|||
var buffer nh.GosmAdapter |
|||
var container nh.GosmAdapter |
|||
|
|||
func main() { |
|||
container = &nh.GosmContainer{nh.GosmContainerSection{"A", "BB", "CCC", true, "DDDD"}, nh.GosmContainerSection{"D", "EE", "FFF", false, "GGGG"}} |
|||
|
|||
fmt.Println(container) |
|||
|
|||
container.Revalue(func(interface{}) interface{} { |
|||
return nh.GosmContainer{nh.GosmContainerSection{"Aneu", "BBneu", "CCCneu", true, "DDDDneu"}, nh.GosmContainerSection{"Dneu", "EEneu", "FFFneu", false, "GGGGneu"}} |
|||
}) |
|||
|
|||
buffer, _ = container.Convert() |
|||
|
|||
fmt.Printf("%T\n", buffer) |
|||
|
|||
puffer := buffer.(*nh.GosmBuffer) |
|||
fmt.Println(*puffer) |
|||
|
|||
newContainer, _ := buffer.Convert() |
|||
fmt.Printf("%T\n", newContainer) |
|||
fmt.Println(newContainer) |
|||
fmt.Println(container) |
|||
|
|||
j, err := json.Marshal(container) |
|||
if err != nil { |
|||
panic(err) |
|||
} |
|||
fmt.Println(j) |
|||
|
|||
} |
|||
|
|||
*/ |
Loading…
Reference in new issue