fix: allow imported binary variables to be set (#85)
Change the way imported binary variables are imported, from `reflect.ValueOf(val)` to `reflect.ValueOf(&val).Elem()`, to allow these variables to be set from the interpreter. Regenerate stdlib packages accordingly. Ensure that binary value is forwarded if it exists. Add tests.
This commit is contained in:
committed by
Ludovic Fernandez
parent
a99fb98f84
commit
6d21cefe75
18
_test/assign0.go
Normal file
18
_test/assign0.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.DefaultClient.Timeout = time.Second * 10
|
||||
fmt.Println(http.DefaultClient)
|
||||
http.DefaultClient = &http.Client{}
|
||||
fmt.Println(http.DefaultClient)
|
||||
}
|
||||
|
||||
// Output:
|
||||
// &{<nil> <nil> <nil> 10s}
|
||||
// &{<nil> <nil> <nil> 0s}
|
||||
Reference in New Issue
Block a user