This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
u := &url.URL{ | |
Scheme: "http", | |
Host: "intelliep-api.rocktl.com", | |
} | |
proxy := httputil.NewSingleHostReverseProxy(u) | |
proxy.Director = func(r *http.Request) { | |
r.Host = "intelliep-api.rocktl.com" | |
r.URL.Host = r.Host | |
r.URL.Scheme = "http" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func initStruct(p reflect.Type) (instance reflect.Value) { | |
instance = reflect.New(p).Elem() | |
if p.Kind() == reflect.Slice { | |
instance.Set(reflect.Append(instance, initStruct(p.Elem()))) | |
return instance | |
} | |
for i := 0; i < p.NumField(); i++ { | |
switch instance.Field(i).Kind() { | |
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |