+ + ```go package main @@ -267,6 +276,7 @@ welcome to singapore
-```go -{ - b := New() - err := b.AddBuilders(DBTestFunc, DBTestFunc4) - fmt.Println(err == nil) - ep, err := b.Compile(TestStruct1{}) - fmt.Println(err == nil) - _, err = ep.Run(context.Background(), TestStruct1{}) - fmt.Println(err == nil) - err = ep.Replace(context.Background(), DBTestFunc, DBTestFunc5) - fmt.Println(err == nil) - _, err = ep.Run(context.Background(), TestStruct1{}) - fmt.Println(err == nil) - -} +```go +b := New() +err := b.AddBuilders(DBTestFunc, DBTestFunc4) +fmt.Println(err == nil) +ep, err := b.Compile(TestStruct1{}) +fmt.Println(err == nil) + +_, err = ep.Run(context.Background(), TestStruct1{}) +fmt.Println(err == nil) + +err = ep.Replace(context.Background(), DBTestFunc, DBTestFunc5) +fmt.Println(err == nil) +_, err = ep.Run(context.Background(), TestStruct1{}) +fmt.Println(err == nil) + +// Output: +// true +// true +// CALLED DBTestFunc +// CALLED DBTestFunc4 +// true +// true +// CALLED DBTestFunc5 +// CALLED DBTestFunc4 +// true ``` #### Output @@ -329,6 +350,7 @@ true