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.
19 lines
286 B
Go
19 lines
286 B
Go
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}
|