Edit: (from comments) I'm looking for a way to modify parts of my program while it's running. I wrote this code only as an example.
Assuming we have such a code:
for {
t := time.Now()
fmt.Print(t.Minute(), ":", t.Second(), " ")
testdll.Testf()
time.Sleep(time.Second * 2)
}
and
package testdll
import (
"fmt"
)
//Testf
func Testf() {
fmt.Println("hello I'm version 1")
}
Is it possible to get this result during runtime when testdll is updated to version 2 and rebuilt?
14:29 hello I'm version 1
14:31 hello I'm version 1
14:33 hello I'm version 1
14:35 hello I'm version 2
14:37 hello I'm version 2
14:39 hello I'm version 2